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

What is Framer? Join the Community
Return to index
James Matchett
Posted Nov 18 - Read on Facebook

Wondering if anyone else is experiencing this or how to fix it. When you scale an imported object the x, y, width and height all remain at the unscaled values. Is there any way to correct this?

10 Comments

Jordan Robert Dobson

Nope. That's really the way it works on the web. What are you hoping to do?

You could do the inverse but then you have the same issue again in the other direction.

James Matchett

well since Sketch imports are blurry I'm bringing everything in at 2x then having to scale down but it's not calculating heights and width accordingly so when you go to move objects around it becomes a nightmare to calculate when you already had to change the height and width of objects to get it wrapped in a scrollComponent properly

Jordan Robert Dobson

Try just changing the actual width and height.

Jordan Robert Dobson

foo.width = foo.width/2

Jordan Robert Dobson

The image inside should scale to fit the frame adjustment.

Jordan Robert Dobson

Yeah I don't use sketch that much. So maybe someone else can help there.

James Matchett

The image scales down but it reports itself as being the original size and original X and Y coordinates so every time you're doing calculates you have to remember when to do a / 2 but the way the scrollComponent wraps a layer you have to set the child of the wrapper layer down by the / 2 then update the contents but then the calculations that involve that child of the wrapper layer you have to remember are the true measurements

James Matchett

I'm just wondering if there was someway to have it recalculate the height width x y values after a scale for all layers

Stephen Crowley

So, maybe Benjamin will have an update on this? As of November 4th they were working with the Sketch team on import issues. Not sure if this specific issue was one but it has been reported before. For now I scale my art boards, so for example on iPhone6 I work in a 750x1336 art board.

James Matchett

I figured a weird work around, I just wrote my own function that looked through a layer's sublayers and halved it's height and width. It works but it's janky

Read the entire post on Facebook