diff options
author | Ian Brown <[email protected]> | 2018-09-30 18:30:49 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2018-09-30 18:30:49 -0700 |
commit | dd694ef6042fdf2d978a978d3750acac2c25557d (patch) | |
tree | e2d2f0f3374cb82e80fab278694f79331d475c63 /src/javax/media/j3d/CanvasViewEventCatcher.java | |
parent | a61cf7db3460ff1e39fd4923b32e4c0450ac8c36 (diff) |
j3d-core: Fix HiDPI issues on Windows
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/javax/media/j3d/CanvasViewEventCatcher.java')
-rw-r--r-- | src/javax/media/j3d/CanvasViewEventCatcher.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/javax/media/j3d/CanvasViewEventCatcher.java b/src/javax/media/j3d/CanvasViewEventCatcher.java index aadbf5f..478a84c 100644 --- a/src/javax/media/j3d/CanvasViewEventCatcher.java +++ b/src/javax/media/j3d/CanvasViewEventCatcher.java @@ -26,6 +26,7 @@ package javax.media.j3d; +import java.awt.Dimension; import java.awt.IllegalComponentStateException; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; @@ -65,7 +66,8 @@ class CanvasViewEventCatcher extends ComponentAdapter { // see comment below try { - canvas.newSize = canvas.getSize(); + Dimension size = canvas.getSize(); + canvas.newSize = new Dimension((int)(size.getWidth()*canvas.xscale), (int)(size.getHeight()*canvas.yscale)); canvas.newPosition = canvas.getLocationOnScreen(); } catch (IllegalComponentStateException ex) {} @@ -90,7 +92,8 @@ class CanvasViewEventCatcher extends ComponentAdapter { // first, then canvas lock in removeComponentListener() try { - canvas.newSize = canvas.getSize(); + Dimension size = canvas.getSize(); + canvas.newSize = new Dimension((int)(size.getWidth()*canvas.xscale), (int)(size.getHeight()*canvas.yscale)); canvas.newPosition = canvas.getLocationOnScreen(); } catch (IllegalComponentStateException ex) {} |