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

What is Framer? Join the Community
Return to index
Marc Krenn
Posted Oct 25 - Read on Facebook

I'm currently writing my first module called "circleConstraint", allowing to constrain a draggable layer to a circle. Unfortunately, I'm stuck at a certain point.

Instead of dragging the constrained layer directly, an invisible helper is used to calculate layer.x/y . Now, I'd like to pass the helper's "private" DragStatus (DragStart, DragMove, DragEnd) on to Framer, so it can be used to trigger events like animations.

I've tried some different approaches (passing&validating arguments etc.), but so far, only a shitty/buggy workaround using Utils.interval worked. There must be a way better, way more elegant way to do this.

http://share.framerjs.com/djsdo474638z/

Can anyone help? Thanks.

4 Comments

Tisho Georgiev

You can trigger a DragEnd event directly on the layer with:

layer.emit Events.DragEnd

Noam Elbaz

Marc Krenn I was trying to build a circular slider a while back but quit. Too hard for me. Best of luck. Looking great.

Marc Krenn

perfect, Tisho! Thanks! (Y)

Mohammed Morsi

Marc Krenn now i'm trying to implement something similar. Did you find a fix?

Read the entire post on Facebook