aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Tsinko <[email protected]>2020-01-22 16:25:49 -0700
committerEgor Tsinko <[email protected]>2020-01-22 16:25:49 -0700
commit3af1fefe1b8338ffa5eb6d2c216467c2488e76a0 (patch)
treed111fe9396a9dca67d1b46edc06fc9eaf398beb0
parent7e122e7557ad71f0ea76ea248032235c19b00d25 (diff)
fixed getPixelLocationFromImagePlate(). Now it works on HiDPI screens
-rw-r--r--src/main/java/org/jogamp/java3d/CanvasViewCache.java6
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 1edb33e..1ecbaf5 100644
--- a/src/main/java/org/jogamp/java3d/CanvasViewCache.java
+++ b/src/main/java/org/jogamp/java3d/CanvasViewCache.java
@@ -2012,9 +2012,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);
}