pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1840975 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java
Date Sat, 15 Sep 2018 18:39:18 GMT
Author: tilman
Date: Sat Sep 15 18:39:18 2018
New Revision: 1840975

URL: http://svn.apache.org/viewvc?rev=1840975&view=rev
Log:
PDFBOX-3353: always render leader lines

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java?rev=1840975&r1=1840974&r2=1840975&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java
Sat Sep 15 18:39:18 2018
@@ -148,6 +148,13 @@ public class PDLineAppearanceHandler ext
             double angle = Math.atan2(y2 - y1, x2 - x1);
             cs.transform(Matrix.getRotateInstance(angle, x1, y1));
             float lineLength = (float) Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2
- y1)));
+
+            // Leader lines
+            cs.moveTo(0, llo);
+            cs.lineTo(0, llo + ll + lle);
+            cs.moveTo(lineLength, llo);
+            cs.lineTo(lineLength, llo + ll + lle);
+
             if (annotation.hasCaption() && !contents.isEmpty())
             {
                 // Note that Adobe places the text as a caption even if /CP is not set
@@ -174,12 +181,6 @@ public class PDLineAppearanceHandler ext
                 float xOffset = (lineLength - contentLength) / 2;
                 float yOffset;
 
-                // Leader lines
-                cs.moveTo(0, llo);
-                cs.lineTo(0, llo + ll + lle);
-                cs.moveTo(lineLength, llo);
-                cs.lineTo(lineLength, llo + ll + lle);
-
                 String captionPositioning = annotation.getCaptionPositioning();
 
                 // draw the line horizontally, using the rotation CTM to get to correct final
position



Mime
View raw message