pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1861178 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Wed, 12 Jun 2019 18:19:10 GMT
Author: tilman
Date: Wed Jun 12 18:19:10 2019
New Revision: 1861178

URL: http://svn.apache.org/viewvc?rev=1861178&view=rev
Log:
PDFBOX-4571: valid lineCap and lineJoin values are 0 and 2

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1861178&r1=1861177&r2=1861178&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
(original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Wed Jun 12 18:19:10 2019
@@ -735,7 +735,9 @@ public class PageDrawer extends PDFGraph
                 }
             }
         }
-        return new BasicStroke(lineWidth, state.getLineCap(), state.getLineJoin(),
+        int lineCap = Math.min(2, Math.max(0, state.getLineCap()));
+        int lineJoin = Math.min(2, Math.max(0, state.getLineJoin()));
+        return new BasicStroke(lineWidth, lineCap, lineJoin,
                                state.getMiterLimit(), dashArray, phaseStart);
     }
 



Mime
View raw message