diff options
author | Philip Jordan <[email protected]> | 2020-01-26 11:37:48 +1300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-26 11:37:48 +1300 |
commit | 1d7e16b8efb40a2696b31cabce248f8275a44e10 (patch) | |
tree | 3e1301fd38fb8a50fae1d7e8ca6ffd40c6c6431e | |
parent | f7921645336c8a2288b2a2ca99e2e1fb2e7f51db (diff) | |
parent | 3af1fefe1b8338ffa5eb6d2c216467c2488e76a0 (diff) |
Merge pull request #4 from etsinko/hidpi-fix
fixed getPixelLocationFromImagePlate(). Now it works on HiDPI screens
-rw-r--r-- | src/main/java/org/jogamp/java3d/CanvasViewCache.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/jogamp/java3d/CanvasViewCache.java b/src/main/java/org/jogamp/java3d/CanvasViewCache.java index 1532a81..8a131fa 100644 --- a/src/main/java/org/jogamp/java3d/CanvasViewCache.java +++ b/src/main/java/org/jogamp/java3d/CanvasViewCache.java @@ -2014,9 +2014,9 @@ class CanvasViewCache extends Object { // Note: screenPt is in image plate coords, at z=0 // Transform from image plate coords to screen coords - pixelLocation.x = (screenX / screenViewCache.metersPerPixelX) - canvasX; - pixelLocation.y = screenViewCache.screenHeight - 1 - - (screenY / screenViewCache.metersPerPixelY) - canvasY; + pixelLocation.x = ((screenX / screenViewCache.metersPerPixelX) - canvasX) / hiDPIXScale; + pixelLocation.y = (screenViewCache.screenHeight - 1 - + (screenY / screenViewCache.metersPerPixelY) - canvasY) / hiDPIYScale; //System.err.println("pixelLocation = " + pixelLocation); } |