1715labs / 1715labs-pfe

Modified version of PFE for use with paid crowds
1715labs-pfe.vercel.app
Apache License 2.0
0 stars 0 forks source link

Only select polygons by their edges #58

Closed tingard closed 2 years ago

tingard commented 2 years ago

Modify polygon to be only selectable by clicking the line, not the face.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/1715labs/1715labs-pfe/3Qx8NejQLFqaoBjKQ8VVuxJhsJg1
✅ Preview: https://1715labs-pfe-git-make-polygon-only-edge-selectable-1715labs.vercel.app

tingard commented 2 years ago

Excellent point... I think we could break them out into two components, and have a "DraggablePolygon" as a separate drawing tool to be added in the future? Don't think we want polygons to ever be draggable for now.

rogerhutchings commented 2 years ago

Fair enough, that's what I figured.

Looking further into the Draggable component, there is an onStart prop that we could use: it accepts a function that can return false to do nothing, or true if the click occurred within a given radius of a line. I'll create a new issue for it should it ever come up