You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PDFGraphics2D has two bugs which share a root cause: 1. When two draw calls are in different clips but share the same color (identical rgba values), the second one is drawn black. 2. Related but slightly different: Colors set before the clip don't affect the clipped objects.
These effects happen because in writeSetClip, a new state is opened which is unaffected by the previously set color. This issue gets more pronounced by the fact that AbstractVectorGraphicsIO optimizes writePaint calls away if the previous current color is the same as the one for the new call - then even setting a color after setting a clip can fail.
The fix is simple: writeSetClip needs to take over the current color to the new state, like it already does for transform and stroke:
PDFGraphics2D has two bugs which share a root cause: 1. When two draw calls are in different clips but share the same color (identical rgba values), the second one is drawn black. 2. Related but slightly different: Colors set before the clip don't affect the clipped objects.
These effects happen because in
writeSetClip
, a new state is opened which is unaffected by the previously set color. This issue gets more pronounced by the fact thatAbstractVectorGraphicsIO
optimizeswritePaint
calls away if the previous current color is the same as the one for the new call - then even setting a color after setting a clip can fail.The fix is simple:
writeSetClip
needs to take over the current color to the new state, like it already does for transform and stroke:The text was updated successfully, but these errors were encountered: