
Here the bounding box of the triangle is not getting attached correctly to the ends of the triangle ,same is the case for all regular polygons.So when we are trying to snap shapes ,shapes are not getting snapped to the ends of regular polygons correctly due to the above mentioned issue.
Here is the link:- https://codesandbox.io/s/react-konva-basic-demo-btuum?file=/index.js
Update:
The issue was solved from Konva side. Updated and working demo: https://codesandbox.io/s/react-konva-transformer-on-polygon-kodm7
Old answer:
Konva calculating the bounding box for regular polygon approximately. Konva just rounds that regular polygon into a circle with the same radius.
As the solution just use Konva.Line or Konva.Path for drawing regular polygons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With