mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
sw_engine: fix update issue
In cases where the fill was changed while the stroke existed but remained unchanged, the stroke would disappear because it was being reset during the shape preparing (shapeReset). Fixed by disabling the reset of stroke rle from shape reseting. Also the shape should be prepared not only when the RenderUpdateFlag is set to Color, but also when it is set to Gradient. @Issue: https://github.com/thorvg/thorvg/issues/3237
This commit is contained in:
parent
ad261731b6
commit
259e380733
2 changed files with 2 additions and 3 deletions
|
@ -123,8 +123,7 @@ struct SwShapeTask : SwTask
|
|||
auto visibleFill = false;
|
||||
|
||||
//This checks also for the case, if the invisible shape turned to visible by alpha.
|
||||
auto prepareShape = false;
|
||||
if (!shapePrepared(&shape) && (flags & RenderUpdateFlag::Color)) prepareShape = true;
|
||||
auto prepareShape = !shapePrepared(&shape) && flags & (RenderUpdateFlag::Color | RenderUpdateFlag::Gradient);
|
||||
|
||||
//Shape
|
||||
if (flags & (RenderUpdateFlag::Path | RenderUpdateFlag::Transform) || prepareShape) {
|
||||
|
@ -185,6 +184,7 @@ struct SwShapeTask : SwTask
|
|||
err:
|
||||
bbox.reset();
|
||||
shapeReset(&shape);
|
||||
rleReset(shape.strokeRle);
|
||||
shapeDelOutline(&shape, mpool, tid);
|
||||
}
|
||||
|
||||
|
|
|
@ -461,7 +461,6 @@ void shapeDelOutline(SwShape* shape, SwMpool* mpool, uint32_t tid)
|
|||
void shapeReset(SwShape* shape)
|
||||
{
|
||||
rleReset(shape->rle);
|
||||
rleReset(shape->strokeRle);
|
||||
shape->fastTrack = false;
|
||||
shape->bbox.reset();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue