mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
sw_engine renderer: fix aliasing problem.
a corner case is detected that anti-aliasing is missing at shapes if the shape has the dash-style stroke. By adding the condition, it applies anti-aliasing properly. @Issues: 394
This commit is contained in:
parent
f1d5571aad
commit
61f07677c5
1 changed files with 3 additions and 2 deletions
|
@ -98,8 +98,9 @@ struct SwShapeTask : SwTask
|
|||
if (renderShape) {
|
||||
/* We assume that if stroke width is bigger than 2,
|
||||
shape outline below stroke could be full covered by stroke drawing.
|
||||
Thus it turns off antialising in that condition. */
|
||||
auto antiAlias = (strokeAlpha == 255 && strokeWidth > 2) ? false : true;
|
||||
Thus it turns off antialising in that condition.
|
||||
Also, it shouldn't be dash style. */
|
||||
auto antiAlias = (strokeAlpha == 255 && strokeWidth > 2 && sdata->strokeDash(nullptr) == 0) ? false : true;
|
||||
if (!shapeGenRle(&shape, sdata, antiAlias, clips.count > 0 ? true : false)) goto err;
|
||||
++addStroking;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue