mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-25 10:56:48 -06:00
Document::next_name summed max + 1 over numbers parsed from existing layer names, and bump_name did the same for the duplicate-rename path: a document (or peer, or node.set) holding a layer named "Frame 18446744073709551615" overflowed both (panic in debug, wrap to a wrong name in release). next_name now collects the numbers it sees and, when the counter is spent, picks the lowest free number (mirrors new_style_id); bump_name only bumps when the number can step, else falls to its existing " 2" branch. Tests: next_name_never_overflows (doc) and duplicating_a_layer_named_past_the_counter_does_not_overflow (engine panel behaviour).