pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1826358 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
Date Fri, 09 Mar 2018 16:31:48 GMT
Author: tilman
Date: Fri Mar  9 16:31:48 2018
New Revision: 1826358

URL: http://svn.apache.org/viewvc?rev=1826358&view=rev
Log:
PDFBOX-4071: avoid floating point equality

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java?rev=1826358&r1=1826357&r2=1826358&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java Fri
Mar  9 16:31:48 2018
@@ -193,8 +193,10 @@ public class PDCIDFontType2 extends PDCI
         {
             PDRectangle bbox = getFontDescriptor().getFontBoundingBox();
             if (bbox != null &&
-                    (bbox.getLowerLeftX() != 0 || bbox.getLowerLeftY() != 0
-                    || bbox.getUpperRightX() != 0 || bbox.getUpperRightY() != 0))
+                    (Float.compare(bbox.getLowerLeftX(), 0) != 0 || 
+                     Float.compare(bbox.getLowerLeftY(), 0) != 0 ||
+                     Float.compare(bbox.getUpperRightX(), 0) != 0 ||
+                     Float.compare(bbox.getUpperRightY(), 0) != 0))
             {
                 return new BoundingBox(bbox.getLowerLeftX(), bbox.getLowerLeftY(),
                                        bbox.getUpperRightX(), bbox.getUpperRightY());



Mime
View raw message