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

What is Framer? Join the Community
Return to index
Peter Hilgersom
Posted Feb 13 - Read on Facebook

hi guys, I'm having a silly issue. How do I animate from the middle of a layer? This is my framer. When you click on the striped icon the background circle animates in size. but it's not coming from middle.

I tired originX = layer.midX and originY = layer.midY but that didnt do it ^_^


Benjamin Den Boer

Hey Peter, ah, yes. Since you're using width/height to grow the circle, it animates from top left. It's quite easy to offset this, though: the circle animates from 150x150 to 200x200, so what you need is to offset the x and y coordinates by the change in size (50) divided by 2 (25), for it to grow from the middle. :)

Simply add the following to your circle state:
x:circle.x-25, y:circle.y-25

Peter Hilgersom

Like a charm, thanks Benjamin!

Peter Hilgersom

Yeah \o/ Addictive tool haha

Read the entire post on Facebook