Closed mkupchik closed 6 months ago
Your fix is not correct. The check is there to see if the path is already tessellated (can happen e.g. calling fill multiple times).
On Tue, Mar 12, 2024 at 7:28 PM Mikhail Kupchik @.***> wrote:
A check if (cache->npaths > 0) on function entry does not make sense given the loop for (j = 0; j < cache->npaths; j++) below. If an entry check passes, then loop will never make at least one iteration. Fix initial check which appears to be an optimization for the case when there are no cached paths.
You can view, comment on, or merge this pull request online at:
https://github.com/memononen/nanovg/pull/669 Commit Summary
- d0c1845 https://github.com/memononen/nanovg/pull/669/commits/d0c1845b2edbf27ad65c7db2d6ba37c1cc344307 Fix comparison in nvg__flattenPaths()
File Changes
(1 file https://github.com/memononen/nanovg/pull/669/files)
- M src/nanovg.c https://github.com/memononen/nanovg/pull/669/files#diff-ddd4e9cf2a4c8bea376d3d84558fc3dc30a55414e8cc4c73d003973d4e9c116f (2)
Patch Links:
- https://github.com/memononen/nanovg/pull/669.patch
- https://github.com/memononen/nanovg/pull/669.diff
— Reply to this email directly, view it on GitHub https://github.com/memononen/nanovg/pull/669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIBXSACM33BYGHXY547XQDYX43NDAVCNFSM6AAAAABESVWXFSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4DEMRXGI2TGMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
A check
if (cache->npaths > 0)
on function entry does not make sense given the loopfor (j = 0; j < cache->npaths; j++)
below. If an entry check passes, then loop will never make at least one iteration. Fix initial check which appears to be an optimization for the case when there are no cached paths.