From 1775dd20eec91ef26ed03741a1d24a9d04a85833 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 21 Sep 2019 16:55:42 +1200 Subject: HiDPI fix improved to work when moving a Canvas between screens, also mouse interactions are now scaled correctly when using the canvas.getPixelLocationInImagePlate(xpos,ypos,mousePosn); as seen in the java3d-utils PickCanvas class --- src/main/java/org/jogamp/java3d/Canvas3D.java | 11 +----- .../java/org/jogamp/java3d/CanvasViewCache.java | 39 ++++++++++++++++++---- .../org/jogamp/java3d/CanvasViewEventCatcher.java | 7 ++-- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/jogamp/java3d/Canvas3D.java b/src/main/java/org/jogamp/java3d/Canvas3D.java index a4f2b95..c678631 100644 --- a/src/main/java/org/jogamp/java3d/Canvas3D.java +++ b/src/main/java/org/jogamp/java3d/Canvas3D.java @@ -32,14 +32,12 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.IllegalComponentStateException; import java.awt.Point; import java.awt.Window; -import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Hashtable; @@ -824,8 +822,6 @@ ArrayList textureIdResourceFreeList = new ArrayList(); // CanvasViewEventCatcher. Point newPosition = new Point(); Dimension newSize = new Dimension(); - double xscale = 1.0; - double yscale = 1.0; // Remember OGL context resources to free // before context is destroy. @@ -1232,14 +1228,9 @@ ArrayList textureIDResourceTable = new ArrayList