exyte/Macaw

Inverted node displayed when manually drawing

Opened this issue · 1 comments

Hi. When drawing paths manually with the mouse and using findNode() in mouseDragged() or touchesMoved() override methods in the ViewController the node will display in the background with whatever stroke and color I am drawing with but also be inverted. I tried to follow the logic in the findNode() source code maze of why that inverted node flashes on screen but I couldn't find a good answer. It's got to be some drawing context that's capturing my stroke color. I tried to save my graphics state in my MacawView draw() method encompassing my setting the stroke color and drawing the paths then restoring it but that didn't work. I have tried drawing on a plain NSView subview and also setting the color to clear after stroking the paths in draw(). Do you have any ideas how I might avoid the node flashing on screen like this?

Thank you.

A little background into what I'm trying to do:
I am attempting to draw across nodes and detect them as soon as I cross from node to node. findNode() works well in mouseDragged() but gives a visual error. If there is a better way using onPan() or onTouchesMoved() please let me know. I am unable to find code showing this and all my efforts came up empty. I can get onTap() to work but dragging across them doesn't seem to.