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 2021/06/05 17:01:31 UTC

svn commit: r1890515 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Author: tilman
Date: Sat Jun  5 17:01:30 2021
New Revision: 1890515

URL: http://svn.apache.org/viewvc?rev=1890515&view=rev
Log:
PDFBOX-5093: make setClip() and getNonStrokingPaint() non private so that they can be called when showGlyph is overridden, as suggested by Alexander Scherbatiy

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1890515&r1=1890514&r2=1890515&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Sat Jun  5 17:01:30 2021
@@ -385,9 +385,14 @@ public class PageDrawer extends PDFGraph
         }
     }
 
-    // sets the clipping path using caching for performance, we track lastClip manually because
-    // Graphics2D#getClip() returns a new object instead of the same one passed to setClip
-    private void setClip()
+    /**
+     * Sets the clipping path using caching for performance. We track lastClip manually because
+     * {@link Graphics2D#getClip()} returns a new object instead of the same one passed to
+     * {@link Graphics2D#setClip(java.awt.Shape) setClip()}. You may need to call this if you
+     * override {@link #showGlyph(Matrix, PDFont, int, Vector) showGlyph()}. See
+     * <a href="https://issues.apache.org/jira/browse/PDFBOX-5093">PDFBOX-5093</a> for more.
+     */
+    protected final void setClip()
     {
         Area clippingPath = getGraphicsState().getCurrentClippingPath();
         if (clippingPath != lastClip)
@@ -727,8 +732,15 @@ public class PageDrawer extends PDFGraph
                 getGraphicsState().getSoftMask());
     }
 
-    // returns the non-stroking AWT Paint
-    private Paint getNonStrokingPaint() throws IOException
+    /**
+     * Returns the non-stroking AWT Paint. You may need to call this if you override
+     * {@link #showGlyph(Matrix, PDFont, int, Vector) showGlyph()}. See
+     * <a href="https://issues.apache.org/jira/browse/PDFBOX-5093">PDFBOX-5093</a> for more.
+     *
+     * @return The non-stroking AWT Paint.
+     * @throws IOException
+     */
+    protected final Paint getNonStrokingPaint() throws IOException
     {
         return applySoftMaskToPaint(
                 getPaint(getGraphicsState().getNonStrokingColor()),