sw_engine: fix clipping

A shape with both fill and stroke, where clipping left
only a fragment of one (either fill or stroke), was not
rendered at all. Now fixed.
This commit is contained in:
Mira Grudzinska 2024-12-29 22:34:41 +01:00 committed by Hermet Park
parent 75a4c7f543
commit 82dc41479e

View file

@ -172,8 +172,9 @@ struct SwShapeTask : SwTask
//Clip Path //Clip Path
for (auto clip = clips.begin(); clip < clips.end(); ++clip) { for (auto clip = clips.begin(); clip < clips.end(); ++clip) {
auto clipper = static_cast<SwTask*>(*clip); auto clipper = static_cast<SwTask*>(*clip);
if (shape.rle && !clipper->clip(shape.rle)) goto err; //Clip shape rle auto clipShapeRle = shape.rle ? clipper->clip(shape.rle) : true;
if (shape.strokeRle && !clipper->clip(shape.strokeRle)) goto err; //Clip stroke rle auto clipStrokeRle = shape.strokeRle ? clipper->clip(shape.strokeRle) : true;
if (!clipShapeRle && !clipStrokeRle) goto err;
} }
bbox = renderRegion; //sync bbox = renderRegion; //sync