You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/06/04 18:06:13 UTC

svn commit: r1832874 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java

Author: tilman
Date: Mon Jun  4 18:06:13 2018
New Revision: 1832874

URL: http://svn.apache.org/viewvc?rev=1832874&view=rev
Log:
PDFBOX-3353: some styles do not rotate with the line, e.g. square and diamond, so add a set constant for angled styles that do rotate, e.g. arrows

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java?rev=1832874&r1=1832873&r2=1832874&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java Mon Jun  4 18:06:13 2018
@@ -58,6 +58,11 @@ public abstract class PDAbstractAppearan
      * Line ending styles where there is an interior color.
      */
     protected static final Set<String> INTERIOR_COLOR_STYLES = createInteriorColorStyles();
+    
+    /**
+     * Line ending styles where the shape changes its angle, e.g. arrows.
+     */
+    protected static final Set<String> ANGLED_STYLES = createAngledStyles();
 
     public PDAbstractAppearanceHandler(PDAnnotation annotation)
     {
@@ -403,6 +408,18 @@ public abstract class PDAbstractAppearan
         return Collections.unmodifiableSet(interiorColorStyles);
     }
 
+    private static Set<String> createAngledStyles()
+    {
+        Set<String> angledStyles = new HashSet<>();
+        angledStyles.add(PDAnnotationLine.LE_CLOSED_ARROW);
+        angledStyles.add(PDAnnotationLine.LE_OPEN_ARROW);
+        angledStyles.add(PDAnnotationLine.LE_R_CLOSED_ARROW);
+        angledStyles.add(PDAnnotationLine.LE_R_OPEN_ARROW);
+        angledStyles.add(PDAnnotationLine.LE_BUTT);
+        angledStyles.add(PDAnnotationLine.LE_SLASH);
+        return Collections.unmodifiableSet(angledStyles);
+    }
+
     /**
      * Get the annotations normal appearance.
      *