-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapping highlight bug #3
Comments
Really missing this in Sketch ;( |
Does it still behave this exact way in the current version of Sketch? |
So... I've looked into this, and I'm mostly just confused. The APIs to get line rectangle information reports that the second line in your example is 'Sketc' instead of 'Sketch' which throws things off. I was thinking that this might have something to do with maybe me giving the incorrect text container width when asking for the lines (the APIs return the line geometry based on the text container width passed in) causing the text to wrap earlier, but I checked and Sketch gives the same width (the width of the text layer) so I'm kind of puzzled. I was going to try adding a pixel or two to the width to fix this, but it's imprecise and might not work for all the cases where this happens... outside of that, I'm not really sure how to fix this. |
Thanks @matt-curtis for looking into it ! • Text containers in fixed mode seem to work pretty well if I'm right. • Auto mode containers not. Nor when the text is initially typed in auto mode (you cannot really create a text container in auto mode if I'm right, it starts in fixed mode that you can set to auto before typing), nor when changing it from fixed to auto. As soon as you convert to auto it cuts some words or parts, as you said, putting the "h" and the next line for example. So the only way I can somehow use it with auto mode typing is to type my text in auto mode, break my lines manually like I want, then convert the container to fixed, but I HAVE TO CHANGE THE FIXED CONTAINER MANUALLY FIRST before hitting the plugin, otherwise it does not work ... Joining the sketch test file Thanks |
First off - that's some fantastic detective work you did, thanks! What I find interesting is that in your tests, highlight works properly in Fixed mode. In my own texts, highlighting doesn't work properly in either mode, both have the same issue. |
No highlight at all in Sketch 50.2 :( Crycrycy ;) |
You may want to give the version I built using the new JS API a try. No guarantees it'll work :) |
See attached file ans screenshot. The highlight shape wraps itself to a next line.
HighlightWrapBug.zip
The text was updated successfully, but these errors were encountered: