changeset 5724:eea9adfd81dc

Fixed RT-33135: Page Setup Dialog updated margins not saved Reviewed-by: jgodinez
author prr
date Fri, 15 Nov 2013 16:45:48 -0800
parents cb506210adbe
children fa1f93d1bd33
files modules/graphics/src/main/java/javafx/print/Printer.java
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/print/Printer.java	Fri Nov 15 16:01:11 2013 -0800
+++ b/modules/graphics/src/main/java/javafx/print/Printer.java	Fri Nov 15 16:45:48 2013 -0800
@@ -348,6 +348,11 @@
         double ptm = imgArea.getMinY();
         double prm = width - imgArea.getMaxX();
         double pbm = height - imgArea.getMaxY();
+        
+        lMargin /= 72.0;
+        rMargin /= 72.0;
+        tMargin /= 72.0;
+        bMargin /= 72.0;
 
         // Check if the requested margins exceed the paper and
         // if they do, ignore them.
@@ -379,10 +384,15 @@
         default: lm = plm; rm = prm; tm = ptm; bm = pbm;
         }
 
-        lm = (lMargin <= lm) ? lMargin : lm;
-        rm = (rMargin <= rm) ? rMargin : rm;
-        tm = (tMargin <= tm) ? tMargin : tm;
-        bm = (bMargin <= bm) ? bMargin : bm;
+        lm = (lMargin >= lm) ? lMargin : lm;
+        rm = (rMargin >= rm) ? rMargin : rm;
+        tm = (tMargin >= tm) ? tMargin : tm;
+        bm = (bMargin >= bm) ? bMargin : bm;
+
+        lm *= 72;
+        rm *= 72;
+        tm *= 72;
+        bm *= 72;
 
         return new PageLayout(paper, orient, lm, rm, tm, bm);
     }