diff options
author | Sven Gothel <[email protected]> | 2020-01-04 17:03:22 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-04 17:03:22 +0100 |
commit | 3b60cb464cea77a22f866155c14c8786dea360ba (patch) | |
tree | fcc93f1fdad8a56ef29b90f9cc3e9b303b21fdf4 | |
parent | e6d53e29f05a6928192f6c4a988b2aa558be8d65 (diff) |
Bug 1358: NewtCanvasSWT High-DPI: Use window-units where required instead of pixel-units
Commit ca7f0fb61b0a608b6e684a5bbde71f6ecb6e3fe0
did one thing wrong: Using the pixel-unit size for
NEWT child window operations where window-units are required.
-rw-r--r-- | src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index bd5c43d6c..562dad091 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -155,11 +155,11 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC if( null != nativeWindow || validateNative() ) { if( newtChildReady ) { if( postSetSize ) { - newtChild.setSize(clientAreaPixels.width, clientAreaPixels.height); + newtChild.setSize(clientAreaWindow.width, clientAreaWindow.height); postSetSize = false; } if( postSetPos ) { - newtChild.setPosition(clientAreaPixels.x, clientAreaPixels.y); + newtChild.setPosition(clientAreaWindow.x, clientAreaWindow.y); postSetPos = false; } newtChild.windowRepaint(0, 0, clientAreaPixels.width, clientAreaPixels.height); @@ -270,14 +270,14 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC } if( sizeChanged ) { if( newtChildReady ) { - newtChild.setSize(nClientAreaPixels.width, nClientAreaPixels.height); + newtChild.setSize(clientAreaWindow.width, clientAreaWindow.height); } else { postSetSize = true; } } if( updatePos && posChanged ) { if( newtChildReady ) { - newtChild.setPosition(nClientAreaPixels.x, nClientAreaPixels.y); + newtChild.setPosition(clientAreaWindow.x, clientAreaWindow.y); } else { postSetPos = true; } @@ -427,8 +427,8 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC newtChild.setFocusAction(null); // no AWT focus traversal .. if(add) { updatePosSizeCheck(false); - final int w = clientAreaPixels.width; - final int h = clientAreaPixels.height; + final int w = clientAreaWindow.width; + final int h = clientAreaWindow.height; // set SWT EDT and start it { @@ -526,12 +526,12 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC @Override public int getWidth() { - return getSurfaceWidth(); // FIXME: Use 'scale' or an actual window-width + return clientAreaWindow.width; } @Override public int getHeight() { - return getSurfaceHeight(); // FIXME: Use 'scale' or an actual window-width + return clientAreaWindow.height; } @Override |