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?
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.
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
Try just changing the actual width and height.
foo.width = foo.width/2
The image inside should scale to fit the frame adjustment.
Yeah I don't use sketch that much. So maybe someone else can help there.
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
I'm just wondering if there was someway to have it recalculate the height width x y values after a scale for all layers
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.
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