changeset 7135:b266db447ddd

Fixed RT-7215) [Printing] Illegal argument exception for HARDWARE_MINIMUM margin Reviewed-by: flar
author prr
date Wed, 21 May 2014 15:33:39 -0700
parents 0db6ba44ef98
children 65119ab613e1
files modules/graphics/src/main/java/javafx/print/Printer.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/print/Printer.java	Wed May 21 15:28:40 2014 -0600
+++ b/modules/graphics/src/main/java/javafx/print/Printer.java	Wed May 21 15:33:39 2014 -0700
@@ -253,6 +253,11 @@
         double ptm = imgArea.getMinY();
         double prm = width - imgArea.getMaxX();
         double pbm = height - imgArea.getMaxY();
+        // fix for FP error
+        if (Math.abs(plm) < 0.01) plm = 0;
+        if (Math.abs(prm) < 0.01) prm = 0;
+        if (Math.abs(ptm) < 0.01) ptm = 0;
+        if (Math.abs(pbm) < 0.01) pbm = 0;
 
         switch (mType) {
         case DEFAULT: