mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
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:
parent
75a4c7f543
commit
82dc41479e
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue