[ 
https://issues.apache.org/jira/browse/PDFBOX-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13912048#comment-13912048
 ] 

John Hewson commented on PDFBOX-1941:
-------------------------------------

Before:

{code}
/**
 * Implementation of content stream operator for page drawer.
 *
 * @author <a href="mailto:[email protected]";>Daniel 
Wilson</a>
 * @version $Revision: 1.1 $
 */
public class ClipEvenOddRule extends OperatorProcessor
{

    /**
     * Log instance.
     */
    private static final Log LOG = LogFactory.getLog(ClipEvenOddRule.class);

    /**
     * process : W* : set clipping path using even odd rule.
     * @param operator The operator that is being executed.
     * @param arguments List
     *
     * @throws IOException if there is an error during execution.
     */
    public void process(PDFOperator operator, List<COSBase> arguments) throws 
IOException
    {

        try 
        {
            PageDrawer drawer = (PageDrawer)context;
            drawer.setClippingWindingRule(GeneralPath.WIND_EVEN_ODD);
        } 
        catch (Exception e) 
        {
            LOG.warn(e, e);
        }
    }
}
{code}

After:
{code}
/**
 * W* Set clipping path using even odd rule.
 * @author Daniel Wilson
 */
public class ClipEvenOddRule extends OperatorProcessor
{
    @Override
    public void process(PDFOperator operator, List<COSBase> arguments)
    {
        ((PageDrawer)context).setClippingWindingRule(GeneralPath.WIND_EVEN_ODD);
    }
}
{code}

> Refactor PageDrawer operators
> -----------------------------
>
>                 Key: PDFBOX-1941
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1941
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>            Priority: Minor
>
> - Clean up the code in org.apache.pdfbox.util.operator.pagedrawer.*. 
> Formatting, JavaDoc, etc.
> - Make sure that no classes in org.apache.pdfbox.util.operator.pagedrawer.* 
> swallow exceptions, except for Invoke.
> - Remove setLinePath from PageDrawer which is only used for combined stroke + 
> fill. Replace it with a new strokeAndFillPath(...) method.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to