Resize and Rotate Transformer

44 views
Skip to first unread message

Adam B

unread,
Dec 15, 2021, 9:23:21 PM12/15/21
to Paper.js
Has anyone successfully built a transformer that can scale and rotate objects? Similar to what Fabric.js has http://fabricjs.com/customization? I get close but once rotated everything is off due to bounds not being updated.

wes.re...@gmail.com

unread,
Dec 22, 2021, 1:36:54 AM12/22/21
to Paper.js
I've built some standard vector drawing tools and have hit this issue. You can either:
  1. Determine width & height by first un-rotating the item then use bounds and then rotate back.
  2. Determine width & height via innerBounds and multiply by scaling.

Adam B

unread,
Dec 22, 2021, 5:07:09 PM12/22/21
to Paper.js

Thanks for getting back to me. I manage to set the bounding box/transformer size and rotation... and then if I try to edit segments they are out of alignment because of having to set applyMatrix to false. It never ends hahaha!
Reply all
Reply to author
Forward
0 new messages