fixed a bug where the viewport would be cut off by the window if the windows height was smaller than the viewports height
This commit is contained in:
@@ -3934,8 +3934,6 @@ class STREAKER extends Shader {
|
|||||||
iterations = (int)params.get(8).value;
|
iterations = (int)params.get(8).value;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("Running..");
|
|
||||||
PGraphics temp = createGraphics(img.width, img.height);
|
PGraphics temp = createGraphics(img.width, img.height);
|
||||||
int off = 0;
|
int off = 0;
|
||||||
color c;
|
color c;
|
||||||
|
|||||||
12
manglr2.pde
12
manglr2.pde
@@ -82,14 +82,18 @@ void draw() {
|
|||||||
|
|
||||||
background(color(0));
|
background(color(0));
|
||||||
viewport = renderer.get();
|
viewport = renderer.get();
|
||||||
|
|
||||||
int imgw, imgh;
|
int imgw, imgh;
|
||||||
if (renderer.width < renderer.height) {
|
if (renderer.width < renderer.height) {
|
||||||
imgh = (int)height;
|
imgh = height;
|
||||||
imgw = int((float(renderer.width)/float(renderer.height))*height);
|
imgw = int((float(renderer.width)/float(renderer.height))*height);
|
||||||
} else {
|
} else {
|
||||||
imgw = (int)width;
|
imgw = width;
|
||||||
imgh = int((float(renderer.height)/float(renderer.width))*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);
|
image(viewport, width/2, height/2, imgw, imgh);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user