Reputation: 11
I have a React project involving image perspective management using perspective.ts in a custom polygon I draw using Konva.
I would like to be able to drag the shape and move individual dots to change the shape and update the new image accordingly.
A "working" codesandbox.
The idea is that I have an array of dots ({x: number, y: number}), I update their position on Drag and draw line between dots. I use perspective ts to apply the image to the image context with sceneFunc.
The problem is that if I try to move one of the dot "outside" its original position on top and left, it fills the remaining space with white background.
I tried to change the coordinates on the canvas in a useEffect when dots are moved, I tried to create a new canvas and apply polygon attributes to it... Nothing seems to fix this specific problem but I'm probably looking in the bad direction.
Any help is appreciated ! (maybe @lavrton ?)
Upvotes: 0
Views: 139