Answer the question
In order to leave comments, you need to log in
How to find out which side an element is closer to when dragging and dropping?
There is a block , when dragging a round block, you need to highlight the side to which it is closer.
Tell me how to implement it?
Answer the question
In order to leave comments, you need to log in
What perversions?
origin - bottom left corner (0;0)
to left side - abs(center.x)
to right side - abs(width-center.x)
to bottom side - abs(center.y)
to top side - abs(height- center.y) You
can compare 4 numbers :)
The option above will not work unsquared and requires 4 sqrt and 8 squaring.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question