mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
sw_engine: fix a regression bug by 0dafe9ff64
rectified the stroke scale factor acquisition.
This commit is contained in:
parent
d356b3f1e2
commit
2257211852
2 changed files with 4 additions and 6 deletions
|
@ -54,6 +54,7 @@ static inline bool mathEqual(float a, float b)
|
|||
return (fabsf(a - b) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
|
||||
static inline bool mathEqual(const Matrix& a, const Matrix& b)
|
||||
{
|
||||
if (!mathEqual(a.e11, b.e11) || !mathEqual(a.e12, b.e12) || !mathEqual(a.e13, b.e13) ||
|
||||
|
@ -64,6 +65,7 @@ static inline bool mathEqual(const Matrix& a, const Matrix& b)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
static inline bool mathRightAngle(const Matrix* m)
|
||||
{
|
||||
auto radian = fabsf(atan2f(m->e21, m->e11));
|
||||
|
|
|
@ -96,12 +96,8 @@ struct SwShapeTask : SwTask
|
|||
|
||||
if (!rshape->stroke->fill && (MULTIPLY(rshape->stroke->color[3], opacity) == 0)) return 0.0f;
|
||||
if (mathZero(rshape->stroke->trim.begin - rshape->stroke->trim.end)) return 0.0f;
|
||||
|
||||
if (transform) {
|
||||
if (transform->e11 > transform->e22) width *= transform->e11;
|
||||
else width *= transform->e22;
|
||||
}
|
||||
return fabsf(width);
|
||||
if (transform) return (width / sqrt(transform->e11 * transform->e11 + transform->e12 * transform->e12));
|
||||
else return width;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue