Free Transform Tool Utility
A set of functions to calculate boundries element resizing, translating, rotating and styles object extraction
Installation
npm install free-transform
Usage
Scale
scale types (Handles)
tl
Top Left Handle
ml
Middle Left Handle
tr
Top Right Handle
tm
Top Middle Handle
bl
Bottom Left Handle
bm
Bottom Middle Handle
br
Bottom Right Handle
mr
Middle Right Handle
let element = x:0 y:0 scaleX:1 scaleY:1 width:100 height:100 angle:0 scaleLimit:01 const onScaleHandleMouseDown = { event; event; const drag = ; const up = { document; document; }; document document }
Rotation
let element = x:0 y:0 scaleX:1 scaleY:1 width:100 height:100 angle:0 scaleLimit:01 const onRotateHandleMouseDown = { event; event; const drag = ; const up = { document; document; }; document document}
Translation (Dragging)
let element = x:0 y:0 scaleX:1 scaleY:1 width:100 height:100 angle:0 scaleLimit:01 const onElementMouseDown = { event; const drag = ; const up = { document; document; }; document; document;}