Replies: 1 comment
-
I have been trying to do this by myself and i did not have much time to finish it. i would try to do it using Acoords, this will better scale to situation in which the objects are rotated by 90 degree or smaller angles. The point is that for each object you likely have the 4 corner that represent 4 snapping points, once you find your snapping point, you calculate how much you are far from that point and increase or decrease scale of the exact amount to get there. That will give you some code that will work better in more generic situations |
Beta Was this translation helpful? Give feedback.
-
I am attempting to align objects to each other on
object:scaling
. I currently have the functionality working onobject:moving
, which uses the https://github.com/fabricjs/fabric.js/blob/master/lib/aligning_guidelines.js logic as a starting point.While scaling, aligning right to right works fine. If I try to align left to left, however, the scaling object keeps moving back and forth.
I've attached a simple example below. The behavior can be replicated by:
https://jsfiddle.net/rm94wcbd/4/
If anyone has any ideas on how to get this to work it would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions