nanovg icon indicating copy to clipboard operation
nanovg copied to clipboard

Fix comparison in nvg__flattenPaths()

Open mkupchik opened this issue 1 year ago • 1 comments

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.

mkupchik avatar Mar 12 '24 17:03 mkupchik

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

File Changes

(1 file https://github.com/memononen/nanovg/pull/669/files)

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: @.***>

memononen avatar Mar 12 '24 20:03 memononen