DWilliames / paddy-sketch-plugin

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

[Bug] Centered "Fixed" text within Symbol resizing to custom width #22

Closed lostsatellites closed 6 years ago

lostsatellites commented 6 years ago

Previously I've been using an Alignment Fixed text layer within buttons and the Resize settings set to scale with the button so that on resize in layout it's easy to set button width by detecting at which point the text wraps. i.e. the Fixed alignment combined with Resize rules helps maintain padding when a user doesn't have the plugin.

After the update the button symbol can no longer change width to account for a longer label, only height. Setting the text to Alignment Auto seems to fix this, but then other users without the plugin lose the ability to size accordingly. The previous version seemed to handle this case correctly.

screen shot 2018-02-13 at 11 32 34 am screen shot 2018-02-13 at 11 35 45 am
saulodourado commented 6 years ago

The same is happening to me. It was working on 1.0.1, but not on 1.0.2

DWilliames commented 6 years ago

Thanks @lostsatellites and @saulodourado for reaching out!

Yeah; I had to change the behaviour a little, for what made more sense with a fixed label.

The behaviour now, in order to be able to resize to your own width, whilst Paddy auto-resizes the height to match would be something like [16 x]. Where x tells Paddy not to worry about resizing to account for padding in the left and right.

However: there appears to be a bug in doing this when the text is 'centered'. It will work if your text if left aligned right now though. I'll try and fix it to work centered too.

Does that change make sense?

Otherwise, if you set the text to be 'fixed'; and you wanted the symbol to have a fixed width, it wasn't really possible beforehand in v1.0.1.

DWilliames commented 6 years ago

I just pushed a release (v1.0.4) that should now fix this. 👍 I reverted the behaviour back to how it was in v1.0.1

I will close this issue for now, assuming that the fix is stable — if you find that it hasn't been fixed, then please re-open this issue.

Cheers!

saulodourado commented 6 years ago

Thanks, it's working again ;)