mirror of
https://github.com/visioncortex/vtracer.git
synced 2026-09-12 07:06:03 -07:00
39cc49061e
Making watershed's cutout native (merge_diff = 0) silently disabled the same-color merge too: merge_similar early-returned on a non-positive threshold, so two adjacent faces with the very same fill — e.g. after a palette snap — kept a useless boundary between them. A threshold of 0 now means 'merge only identical-color neighbours' (a boundary between two same-colored faces is never useful); negative disables merging entirely. The regression test snaps two boundary-sharing regions to the same palette entry with a third region between them in stack order, so the layer-level MergeAdjacent (consecutive runs only) cannot mask the mosaic merge: 3 faces with the bug, 2 with the fix. The zero-threshold unit test now asserts the new semantics, and negative-threshold identity.