mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
divide width and height by 2f to properly take into account resolutions
that are not divisible by 2
This commit is contained in:
@@ -156,7 +156,7 @@ public class PGraphics2D extends PGraphicsOpenGL {
|
||||
|
||||
@Override
|
||||
protected void defaultCamera() {
|
||||
super.camera(width/2, height/2);
|
||||
super.camera(width/2f, height/2f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4278,10 +4278,10 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
public void ortho(float left, float right,
|
||||
float bottom, float top,
|
||||
float near, float far) {
|
||||
left -= width/2;
|
||||
right -= width/2;
|
||||
bottom -= height/2;
|
||||
top -= height/2;
|
||||
left -= width/2f;
|
||||
right -= width/2f;
|
||||
bottom -= height/2f;
|
||||
top -= height/2f;
|
||||
|
||||
// Flushing geometry with a different perspective configuration.
|
||||
flush();
|
||||
|
||||
Reference in New Issue
Block a user