fix(canvas): clear stale eraser cursor on reassignment and tool switch - #42
Conversation
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
left a comment
There was a problem hiding this comment.
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. |
…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.
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.