From 4f7d94cd8b89cbacf39fdfdc25c21494159153f9 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Mon, 24 Feb 2025 23:23:16 +0100 Subject: [PATCH] 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 --- src/renderer/gl_engine/tvgGlTessellator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/gl_engine/tvgGlTessellator.cpp b/src/renderer/gl_engine/tvgGlTessellator.cpp index 73f8d2db..73664964 100644 --- a/src/renderer/gl_engine/tvgGlTessellator.cpp +++ b/src/renderer/gl_engine/tvgGlTessellator.cpp @@ -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;