This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jason Nelson
Posted Sep 21 - Read on Facebook

Anyone have any thoughts or examples for a clean, elegant way of restricting the drag of an object strictly to 90 degree angles (horizontal *or* vertical, nothing diagonal). I've got a hack that checks for a delta after moving the layer, but sometimes it doesn't always get registered.

3 Comments

Aalok Trivedi

layerA.draggable.directionLock = true

Jordan Robert Dobson

Well you could check if the dragDirection is "up" or "down"
And then on drag set the X value to its starting X value or maybe disable the draggable speed by setting it to 0?

Then do the same for "left" or "right" but this time disable Y value changes.

Jason Nelson

Thanks, Aalok! Exactly what I needed.

Read the entire post on Facebook