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

John Hewson commented on PDFBOX-1966:
-------------------------------------

No, toShadingPaint() shouldn't be moved to PDShading, that's actually where it 
previously had been before the color space refactoring. It was moved to 
PDPattern so that all color handling code is encapsulated inside color spaces, 
i.e. subclasses of PDColorSpace. Only subclasses of PDColorSpace and 
PageDrawer, and our xxxxPaint classes should know about AWT Paint.

The only change you need is to reimplement shFill as you described, but you 
need to pass the current stream's resources to the PDPattern constructor:

{code}
Paint paint = new 
PDPattern(getResources().getPatterns()).toShadingPaint(pdShadingPattern, 
pageHeight);
{code}

> Type 1, 4 and 5 shadings for shFill()
> -------------------------------------
>
>                 Key: PDFBOX-1966
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1966
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 1.8.4, 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>              Labels: shading, shadingpattern
>             Fix For: 1.8.5, 2.0.0
>
>         Attachments: asy-functionshading.pdf, asy-functionshading.pdf-1.tif, 
> hsv-shading.pdf, hsv-shading.pdf-1.png
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> I found two images that didn't render properly. The reason is that the 
> appropriate code was missing in shFill() (the code is there for axial and 
> radial shading). I will fix this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to