mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
sw_engine: fix aa
For shapes with a stroke that has opacity, anti-aliasing should be applied to a fill. The use of a transparent gradient stroke will also be handled correctly.
This commit is contained in:
parent
e4c4a95495
commit
57cdff0d9e
2 changed files with 2 additions and 1 deletions
|
@ -86,7 +86,7 @@ struct SwShapeTask : SwTask
|
|||
Additionally, the stroke style should not be dashed. */
|
||||
bool antialiasing(float strokeWidth)
|
||||
{
|
||||
return strokeWidth < 2.0f || rshape->stroke->dashCnt > 0 || rshape->stroke->strokeFirst || rshape->strokeTrim();
|
||||
return strokeWidth < 2.0f || rshape->stroke->dashCnt > 0 || rshape->stroke->strokeFirst || rshape->strokeTrim() || rshape->stroke->color[3] < 255;;
|
||||
}
|
||||
|
||||
float validStrokeWidth()
|
||||
|
|
|
@ -296,6 +296,7 @@ struct Shape::Impl
|
|||
if (!rs.stroke) rs.stroke = new RenderStroke();
|
||||
if (rs.stroke->fill && rs.stroke->fill != p) delete(rs.stroke->fill);
|
||||
rs.stroke->fill = p;
|
||||
rs.stroke->color[3] = 0;
|
||||
|
||||
flag |= RenderUpdateFlag::Stroke;
|
||||
flag |= RenderUpdateFlag::GradientStroke;
|
||||
|
|
Loading…
Add table
Reference in a new issue