Skip to content

Understanding Dynamic Aligning #6918

Answered by melchiar
D-Cryp7 asked this question in Q&A
Mar 6, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

When you set the object's left value, you should use a Math.max() statement so that if the drag position is larger than the boundary then it uses the drag position instead activeObject.set('left', Math.max(left, activeObject.left))

https://jsfiddle.net/melchiar/xu7fedgj/

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@D-Cryp7
Comment options

Answer selected by D-Cryp7
Comment options

You must be logged in to vote
1 reply
@D-Cryp7
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #6915 on March 08, 2021 04:39.