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
Asked
Active
Viewed 1,128 times
6

6by3
- 448
- 2
- 5
- 15

Athul R Nath
- 73
- 4
-
1Hello Athul, welcome to stackoverflow. Please include any code examples that you've tried as text in the question itself, not as a link. You can use the "Code Sample" button in the editor pane for your question to properly format code. You may also get more responses / views to this question by adding 'javascript' as a question category. – cronburg Jul 21 '20 at 15:48
1 Answers
3
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.

lavrton
- 18,973
- 4
- 30
- 63
-
Thanks for the soloution,it worked.We are now using path for drawing regular polygons.But there are still some issues regarding transformer endpoints upon scaling up. – Athul R Nath Jul 31 '20 at 11:19
-