Browse Source

fixed a bug where the viewport would be cut off by the window if the windows height was smaller than the viewports height

master
Victor Giers 2 years ago
parent
commit
7352ce357d
2 changed files with 8 additions and 6 deletions
  1. 0
    2
      effects.pde
  2. 8
    4
      manglr2.pde

+ 0
- 2
effects.pde View File

@@ -3934,8 +3934,6 @@ class STREAKER extends Shader {
iterations = (int)params.get(8).value;



println("Running..");
PGraphics temp = createGraphics(img.width, img.height);
int off = 0;
color c;

+ 8
- 4
manglr2.pde View File

@@ -82,14 +82,18 @@ void draw() {

background(color(0));
viewport = renderer.get();
int imgw, imgh;
if (renderer.width < renderer.height) {
imgh = (int)height;
imgh = height;
imgw = int((float(renderer.width)/float(renderer.height))*height);
} else {
imgw = (int)width;
imgh = int((float(renderer.height)/float(renderer.width))*width);
imgw = width;
imgh = int(width/(float(renderer.width)/float(renderer.height)));
if (imgh > height) {
imgh = height;
imgw = int((float(renderer.width)/float(renderer.height))*height);
}
}
image(viewport, width/2, height/2, imgw, imgh);


Loading…
Cancel
Save