|
|
@@ -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); |
|
|
|
|