react-canvas-draw icon indicating copy to clipboard operation
react-canvas-draw copied to clipboard

Question: How can i base points using percentage instead of fixed x and y?

Open robinodling opened this issue 5 years ago • 4 comments

I would like the canvas to be resizable in the sense that if I draw a line in the middle of the canvas, when I resize the canvas, I still want the line to be in the middle.

Is it possible using this library out of the box? If not, how would I go about modifying the code?

robinodling avatar Nov 07 '19 15:11 robinodling

This is currently not supported out of the box.

A good start point to add this feature would be the handleCanvasResize callback at https://github.com/embiem/react-canvas-draw/blob/master/src/index.js#L296

embiem avatar Nov 22 '19 12:11 embiem

@robinodling Did you have any luck with modifying the code? I'm in need of similar solution.

ksocha avatar Jan 08 '20 15:01 ksocha

@robinodling Also in need of this, anyone make any traction on this?

thegeminisociety avatar Mar 31 '20 15:03 thegeminisociety

Made a rough proof of concept here. Sep-14-2020 12-47-32

Note that it's just a quick hack at this point, it needs some polish to make it play nice with other props.

pzal avatar Sep 14 '20 10:09 pzal