aotuai / brainframe-qt

🧠🖼️ The official desktop client for BrainFrame, made with Qt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

BestDriverCN opened this issue · comments

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.

Great use of 凹

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.