Skip to content

fix(canvas): clear stale eraser cursor on reassignment and tool switch - #42

Merged
markm39 merged 3 commits into
mathnotes-app:mainfrom
PelumiWeb:fix/stale-eraser-cursor
Aug 6, 2026
Merged

fix(canvas): clear stale eraser cursor on reassignment and tool switch#42
markm39 merged 3 commits into
mathnotes-app:mainfrom
PelumiWeb:fix/stale-eraser-cursor

Conversation

@PelumiWeb

Copy link
Copy Markdown
Contributor

The eraser cursor is a native-only overlay whose state was never reset on engine-pool reassignment or tool change, so a recycled view kept drawing the previous page's circle. Reset it in C++ clear(), on Android tool switch, and in the iOS transient-state reset.

The eraser cursor is a native-only overlay whose state was never reset on
engine-pool reassignment or tool change, so a recycled view kept drawing the
previous page's circle. Reset it in C++ clear(), on Android tool switch, and
in the iOS transient-state reset.

@markm39 markm39 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall fix has good intent, but the Android reset currently checks currentEraserMode inside an asynchronously queued GL-thread callback. If another tool update occurs before that callback executes, it can inspect the newer mode and skip clearing the stale cursor. The legacy setTool command also bypasses this reset.

Please centralize cursor hiding in SkiaDrawingEngine::setToolWithParams() using that call’s supplied tool/mode, route both Android tool-setting paths through it, and add regression coverage for tool/mode switching and pooled-engine reassignment.

@PelumiWeb

Copy link
Copy Markdown
Contributor Author

The overall fix has good intent, but the Android reset currently checks currentEraserMode inside an asynchronously queued GL-thread callback. If another tool update occurs before that callback executes, it can inspect the newer mode and skip clearing the stale cursor. The legacy setTool command also bypasses this reset.

Please centralize cursor hiding in SkiaDrawingEngine::setToolWithParams() using that call’s supplied tool/mode, route both Android tool-setting paths through it, and add regression coverage for tool/mode switching and pooled-engine reassignment.

Oh, okay.
I'll add a fix.

PelumiWeb and others added 2 commits August 5, 2026 18:54
…s + regression tests Address review: decide cursor visibility from setToolWithParams' supplied

tool/mode (no GL-thread race), route both Android tool paths through it, and
add C++ regression coverage for tool/mode switching and pooled reassignment.
@markm39
markm39 merged commit 2c0e745 into mathnotes-app:main Aug 6, 2026
1 check passed
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