aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Tsinko <[email protected]>2020-02-25 09:14:39 -0700
committerEgor Tsinko <[email protected]>2020-02-25 09:14:39 -0700
commitac5279a0929a1ef69b7c546497c52d778a835d75 (patch)
tree0ff0caf248237ce2b30e78844f2c76608ac9ffa5
parentb10001eb92e74002e7034309193ea4131e6157ab (diff)
Fixes to Canvas3D.getPixelWidth() and Canvas3D.getPixelHeight()
Sometimes, if canvas is resized, CanvasViewCache is not updated before a frame is rendered. As the result of this the width and height values in the cache are incorrect.
-rw-r--r--src/main/java/org/jogamp/java3d/Canvas3D.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/jogamp/java3d/Canvas3D.java b/src/main/java/org/jogamp/java3d/Canvas3D.java
index 9188ae0..d099f5e 100644
--- a/src/main/java/org/jogamp/java3d/Canvas3D.java
+++ b/src/main/java/org/jogamp/java3d/Canvas3D.java
@@ -2851,7 +2851,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
public int getPixelWidth() {
if (canvasViewCache != null) {
synchronized (canvasViewCache) {
- return canvasViewCache.getCanvasWidth();
+ return (int) (getWidth() * canvasViewCache.getHiDPIXScale());
}
}
return getWidth();
@@ -2863,7 +2863,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
public int getPixelHeight() {
if (canvasViewCache != null) {
synchronized (canvasViewCache) {
- return canvasViewCache.getCanvasHeight();
+ return (int) (getHeight() * canvasViewCache.getHiDPIYScale());
}
}
return getHeight();