sw_engine: fix a regression bug by 0dafe9ff64

rectified the stroke scale factor acquisition.
This commit is contained in:
Hermet Park 2023-09-12 11:06:25 +09:00 committed by Hermet Park
parent d356b3f1e2
commit 2257211852
2 changed files with 4 additions and 6 deletions

View file

@ -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));

View file

@ -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;
}