Snapping To A Grid of TopLefts?

Martin Koob mkoob at rogers.com
Sun Oct 19 14:21:54 EDT 2014


This will snap to a 100 X 75 grid anywhere on the card.  It does not restrict
the bounds i.e. left from 50 to 275, but that could be added.

on mouseUp
   put the top of me into tTop
   put the left of me into tLeft
   put round(tTop / 75) * 75 into tNewTop
   put round(tLeft /100) * 100 into tNewLeft
   lock screen
   set the top of me to tNewTop
   set the left of me to tNewLeft
   unlock screen
   put the topLeft of me
end mouseUp

on mouseDown
   grab me
end mouseDown





--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Snapping-To-A-Grid-of-TopLefts-tp4684742p4684744.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list