Auto-sizing text layers is disabled #111
Comments
matt-curtis
added enhancement help wanted
labels
Dec 2, 2016
ajilderda
commented
Apr 15, 2017
|
Hi Matt, I'm not sure if I understand the problem correctly, but is |
|
@ajilderda That's great - looks like it solves the problem! Putting this into place. |
ajilderda
commented
Apr 26, 2017
|
Nice! |
|
@ajilderda Trying to get this to work now on a fixed text layer and it doesn't seem to have any affect. Any idea what I'm doing wrong? |
ajilderda
commented
May 2, 2017
|
No idea. I assume you loop through the layers and use |
|
Weird. I have a document where I've created a fixed-width text layer and am running this in the console with no affect. I guess it doesn't work any more? const textLayer = context.selection[0];
textLayer.adjustFrameToFit(); |
ajilderda
commented
May 2, 2017
|
The code you provided works here. Here's how to reproduce it:
Does that help? |
|
Thank you for taking the time to write that up. Oddly enough, even following your instructions exactly it's not working for me. What version of Sketch are you running? |
ajilderda
commented
May 2, 2017
|
No problem! That's indeed odd. I'm using Sketch 43.2 with fluid 1.7.4. |
|
Fixed using macOS TextKit APIs. |
matt-curtis commentedDec 2, 2016
The more recent versions of Sketch have changed the backing implementation of text layers (
MSTextLayer), making it impossible/more difficult to get the bounding size of text within a text layer. This feature has been disabled until an alternative can be found.