Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverted node displayed when manually drawing #757

Open
mcbauer08 opened this issue May 11, 2021 · 1 comment
Open

Inverted node displayed when manually drawing #757

mcbauer08 opened this issue May 11, 2021 · 1 comment

Comments

@mcbauer08
Copy link

mcbauer08 commented May 11, 2021

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.

@mcbauer08 mcbauer08 changed the title Visual bug when drawing on screen Visual anomoly when manually drawing May 11, 2021
@mcbauer08 mcbauer08 changed the title Visual anomoly when manually drawing Inverted node when manually drawing May 11, 2021
@mcbauer08 mcbauer08 changed the title Inverted node when manually drawing Inverted node displayed when manually drawing May 11, 2021
@mcbauer08
Copy link
Author

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.

@mcbauer08 mcbauer08 reopened this May 13, 2021
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

No branches or pull requests

1 participant