Skip to content

Commit f6ecf78

Browse files
committed
divide width and height by 2f to properly take into account resolutions
that are not divisible by 2
1 parent b064bb2 commit f6ecf78

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/src/processing/opengl/PGraphics2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void camera(float eyeX, float eyeY, float eyeZ,
156156

157157
@Override
158158
protected void defaultCamera() {
159-
super.camera(width/2, height/2);
159+
super.camera(width/2f, height/2f);
160160
}
161161

162162

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,10 +4278,10 @@ public void ortho(float left, float right,
42784278
public void ortho(float left, float right,
42794279
float bottom, float top,
42804280
float near, float far) {
4281-
left -= width/2;
4282-
right -= width/2;
4283-
bottom -= height/2;
4284-
top -= height/2;
4281+
left -= width/2f;
4282+
right -= width/2f;
4283+
bottom -= height/2f;
4284+
top -= height/2f;
42854285

42864286
// Flushing geometry with a different perspective configuration.
42874287
flush();

0 commit comments

Comments
 (0)