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

Walkthrough bug: Can't snap to intersection during 'lines' step. #648

Closed
Bonkles opened this issue Nov 12, 2022 · 3 comments
Closed

Walkthrough bug: Can't snap to intersection during 'lines' step. #648

Bonkles opened this issue Nov 12, 2022 · 3 comments
Assignees
Milestone

Comments

@Bonkles
Copy link
Contributor

Bonkles commented Nov 12, 2022

While testing the walkthrough, I noticed something is preventing us from snapping the drawing way to an existing street, which is required to proceed through the walkthrough.

Unsure if this is a generic hovering problem or an issue specifically with the walkthrough code.

Pic of the node not snapping to the way:

Image

Note though that I can snap to either of the nodes on the way.

@Bonkles Bonkles added this to the v2 Alpha 3 milestone Nov 12, 2022
@Bonkles
Copy link
Contributor Author

Bonkles commented Nov 15, 2022

I can get the snapping to work if I add a bunch of debug statements to the rendering code to slow it down, and then ZOOM the mouse to the way as fast as possible before the code can catch up. This makes me think that the problem isn't Pixi, it's that whatever we're drawing is 'blocking' the hover/snap code from firing.

@Bonkles
Copy link
Contributor Author

Bonkles commented Nov 15, 2022

Success! Got it working.

Image

After re-adding the 'drawing' class to the in-progress features that are currently being drawn (for example, drawing a polygon or way during the 'Line' or 'Area draw' modes), I was able to get this to work.

The 'drawing' class signals both the line and way renderer code (specifically, the PixiFeatureLine and PixiFeaturePolygon classes) to clear any hit Targets that the feature has while it's being drawn. This allows the Event subsystem to detect hovering/collision with other features on the map.

Interestingly, the reason that the NODES can be snapped to is because the nodes are drawn 'above' everything else, in a higher z-indexed container, so when PIXI does its hit detection, it hit the nodes just fine.

Bonkles added a commit that referenced this issue Nov 15, 2022
@Bonkles
Copy link
Contributor Author

Bonkles commented Nov 15, 2022

Fixed in 9cb845c89.

@Bonkles Bonkles closed this as completed Nov 15, 2022
@Bonkles Bonkles self-assigned this Nov 15, 2022
This was referenced Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏁 Done
Development

No branches or pull requests

1 participant