changeset 9467:35599ecb04bc jdk-9+99

8143598: Stage.setMinWidth and Stage.setMinHeight is useless with DPI scaling enabled Reviewed-by: kcr
author flar
date Mon, 21 Dec 2015 00:08:47 -0800
parents 8adbdda40fdb
children 70e377c26b49 0ee0788b8151
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Sun Dec 20 20:48:44 2015 +0200
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Mon Dec 21 00:08:47 2015 -0800
@@ -330,10 +330,16 @@
     }
 
     @Override public void setMinimumSize(int minWidth, int minHeight) {
+        float pScale = platformWindow.getPlatformScale();
+        minWidth  = (int) Math.ceil(minWidth  * pScale);
+        minHeight = (int) Math.ceil(minHeight * pScale);
         platformWindow.setMinimumSize(minWidth, minHeight);
     }
 
     @Override public void setMaximumSize(int maxWidth, int maxHeight) {
+        float pScale = platformWindow.getPlatformScale();
+        maxWidth  = (int) Math.ceil(maxWidth  * pScale);
+        maxHeight = (int) Math.ceil(maxHeight * pScale);
         platformWindow.setMaximumSize(maxWidth, maxHeight);
     }