Skip to content

[annotations] Delete fully erased annotations#2128

Merged
frankrousseau merged 7 commits into
cgwire:mainfrom
ivancea:fix/delete-fully-erased-annotations
Jul 14, 2026
Merged

[annotations] Delete fully erased annotations#2128
frankrousseau merged 7 commits into
cgwire:mainfrom
ivancea:fix/delete-fully-erased-annotations

Conversation

@ivancea

@ivancea ivancea commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

When erasing annotations, even after fully erasing them, they are still left as invisible selectables.

For example, given these annotations:
imagen

After erasing the 'B' letter:
imagen
imagen

Solution

When an annotation is fully erased, remove it, so it doesn't add noise when selecting.

  • Render erased annotations offscreen and inspect their alpha pixels.
  • Delete objects only when no meaningful pixels remain.
  • Keep partially erased objects and preserve undo/redo.
  • Enable per-pixel hit testing so masked areas are not selectable.
  • Cover full, partial, thin-stroke, persistence, and undo/redo cases with tests.

@ivancea

ivancea commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

#2118 could affect this logic (Maybe?), so I'll review this after that one is merged. In case there's some weird interaction

@frankrousseau frankrousseau merged commit c4374c2 into cgwire:main Jul 14, 2026
@ivancea ivancea deleted the fix/delete-fully-erased-annotations branch July 14, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants