Skip to content

Commit 96d8859

Browse files
committed
don't query window's surface scale if graphics are not retina
1 parent a4d9289 commit 96d8859

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,14 @@ public void setSize(int width, int height) {
523523
}
524524

525525
public float getPixelScale() {
526-
window.getCurrentSurfaceScale(currentPixelScale);
527-
return currentPixelScale[0];
526+
if (graphics.is2X()) {
527+
// Even if the graphics are retina, the user might have moved the window
528+
// into a non-retina monitor, so we need to check
529+
window.getCurrentSurfaceScale(currentPixelScale);
530+
return currentPixelScale[0];
531+
} else {
532+
return 1;
533+
}
528534
}
529535

530536
public Component getComponent() {

0 commit comments

Comments
 (0)