gl_engine: fix differences in dashing among engines

The differences resulted from discrepancies between
the engines in applying equality or inequality signs.

@Issue: https://github.com/thorvg/thorvg/issues/3265
This commit is contained in:
Mira Grudzinska 2025-02-24 23:23:16 +01:00
parent 52dc586089
commit 4f7d94cd8b

View file

@ -2300,7 +2300,7 @@ void DashStroke::dashLineTo(const GlPoint &to)
this->lineTo(curr.p2);
}
if (mCurrLen < 1) {
if (mCurrLen < 0.1f) {
mCurrIdx = (mCurrIdx + 1) % mDashCount;
mCurrLen = mDashPattern[mCurrIdx];
mCurOpGap = !mCurOpGap;
@ -2352,7 +2352,7 @@ void DashStroke::dashCubicTo(const GlPoint &cnt1, const GlPoint &cnt2, const GlP
this->cubicTo(cur.ctrl1, cur.ctrl2, cur.end);
}
if (mCurrLen < 1) {
if (mCurrLen < 0.1f) {
mCurrIdx = (mCurrIdx + 1) % mDashCount;
mCurrLen = mDashPattern[mCurrIdx];
mCurOpGap = !mCurOpGap;