DWilliames / paddy-sketch-plugin

Automated padding, spacing and alignment for your Sketch layers
MIT License
2.17k stars 61 forks source link

[Enhancement] Resizing groups with padding to exact value #65

Open highvoltaged opened 6 years ago

highvoltaged commented 6 years ago

Currently if you have padding in a group, you can't resize the group to exact value. This makes it rather unuseful in most designing situations that require exact sizes.

Create a rectangle with 600x400 size, add an other rectangle with padding of 50. Group should be 700x500 now. Try to enter 400px for width on the group for example After refreshing it will be 443x500

Expected behavior:

Groups should be able to resize inside padded contents and obey entered size.

DWilliames commented 6 years ago

This is another really great idea @highvoltaged!

I think this would be tremendously helpful... although it might be tricky to implement 🤔 :P

I'd assume all the sibling layers would have to be resized taking into account their 'resize' attributes? (e.g. fixed width, fixed left spacing)

highvoltaged commented 6 years ago

Yeah i noticed in similar plugins, like Autolayout, it does the same, seems to be a Sketch thing.

Alternatively you could implement an own "resize" action, and maybe you have more control ower sizing then? Not relying on Sketch's update. Just an idea, don't really know how the scripting works.

highvoltaged commented 6 years ago

I'd assume all the sibling layers would have to be resized taking into account their 'resize' attributes? (e.g. fixed width, fixed left spacing)

Yeah it should calculate the padding into the final size, so making the siblings smaller by the padding amount. But this could potentially create zero sized objects if you make something smaller than the padding allows.