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

Check if a polygon is valid after all point are drawn. #169

Open
BestDriverCN opened this issue Jun 22, 2021 · 2 comments
Open

Check if a polygon is valid after all point are drawn. #169

BestDriverCN opened this issue Jun 22, 2021 · 2 comments

Comments

@BestDriverCN
Copy link
Contributor

BrainFrame client will check if the polygon is valid after each point is drawn. This makes it hard to draw a complicated polygon, for example, a shape polygon, because some lines will be crossing in the middle of the drawing. So maybe check the polygon is valid after the user clicks the Confirm button will be more ideal.

@apockill
Copy link
Member

Great use of 凹

@BryceBeagle
Copy link
Member

BryceBeagle commented Jun 22, 2021

We have the screen draw the would-be polygon while the user is hovering before adding a point by clicking.

We could only draw the complete polygon (i.e. with the first and last points connected) if the polygon is valid. If the click would create a (temporarily) invalid polygon, it would just be adding a single line segment.

Then, if the user clicks to add the point, the drawn polygon (now without hovering) would also be incomplete and the button to confirm would be disabled.

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

3 participants