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

What is Framer? Join the Community
Return to index
Christie Gettler Tarazon
Posted Oct 28 - Read on Facebook

Hi all!
Can you speak to a specific vertex on an object? say, if i want a rectangle to scale based on how far one of its corners is dragged, I'd assume I'd have to make a draggable event listener for the corner. Is that correct, and is this possible?

6 Comments

Christie Gettler Tarazon

alternatively, a hack could be to add a transparent object above the vertex that can have a drag event control the scale of the rectangle.... would that work?

Kevyn Arnott

It's complicated, but you can do it without a transparent layer. Basically, I tricked the layer into spitting out dragging data, then mapped the scale based on which corner was dragged, and then scaled it using a set speed. Here's the example http://share.framerjs.com/tij4omd2woqn/

Christie Gettler Tarazon

this is exactly what I was looking for! thanks so much, going to dig in now and see if I understand it :)

Christie Gettler Tarazon

another curve ball for you: can you scale the width incongruently? literally as if you were dragging the top right corner but not the bottom right corner?

Kevyn Arnott

Yeah, you'd probably want to set the x/maxX & y/maxY, depending on the corner being dragged, on every instance of scale, so it'll appear that the layer isn't scaling at all sides.

Christie Gettler Tarazon

would that still work if i wanted the user to have the ability to also scale from the lower right corner? that is to say, if i set an maxX and maxY for the bottom right so that it doesn't scale when the upper right is being dragged, could I override the maxX and maxY? (like maybe set the maxX and maxY as the corner's current x y position, within the function for the opposite corner being dragged?)

Read the entire post on Facebook