aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-31 22:40:55 +0100
committerSven Gothel <[email protected]>2023-01-31 22:40:55 +0100
commit84fe8402e4845ee1e14071e4922a7f2b3b445851 (patch)
tree637a497114c46c08e670a61befafcdfe023f7af9
parent97de7b52b8c0ca7f1afff394321a15e7f3df293d (diff)
NEWT MonitorDevice: Fix pixelScale storage, own float[2], don't reuse given object
-rw-r--r--src/newt/classes/com/jogamp/newt/MonitorDevice.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
index 97b04a4b3..9ad194ce8 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
@@ -153,7 +153,11 @@ public abstract class MonitorDevice {
this.sizeMM = sizeMM;
this.originalMode = currentMode;
this.supportedModes = supportedModes;
- this.pixelScale = null != pixelScale ? pixelScale : new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+ if( null != pixelScale ) {
+ this.pixelScale = new float[] { pixelScale[0], pixelScale[1] };
+ } else {
+ this.pixelScale = new float[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+ }
this.viewportPU = viewportPU;
this.viewportWU = viewportWU;