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
Crop leading & trailing whitespace #4247
Conversation
Size Change: +6.56 kB (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well. Just a few comments, as I know this is WIP.
It's still missing the migration, right? When working on an old story without changing the font, the text flies all over the place, but that's to be expected I guess?
assets/src/edit-story/components/canvas/singleSelectionMoveable/useResize.js
Outdated
Show resolved
Hide resolved
@miina I tried to redo this (in edit mode and not) but can't get to this state, is it reproducible on your side? if yes - can you record a small video? (optionally attach story data dump[base64] right before that issue [before changing the font size to 50?]) |
@merapi Just tested, it seems to be reproducible, at least partially.
Note that now when testing the issue doesn't appear with all the width/font-size values. If you try the following, it should eventually appear: Let me know if you can reproduce it. |
For a good start, I did a small change: we don't crop anything if there are no font metrics available - tested that on a few old stories and it looks good (text elements are not exploding when resized). In that scenario only newly added text elements will behave differently (will crop whitespace). |
Hopefully, both are resolved (our Slack chat). |
# Conflicts: # assets/src/edit-story/elements/text/display.js
Codecov Report
@@ Coverage Diff @@
## main #4247 +/- ##
==========================================
- Coverage 83.49% 83.34% -0.15%
==========================================
Files 856 861 +5
Lines 14981 15140 +159
==========================================
+ Hits 12508 12619 +111
- Misses 2473 2521 +48
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Migration possibilities were briefly discussed here - PTAL. |
Ah, alright -- didn't realize that re-selecting the font family was the accepted solution -- thanks! |
@csossi We still have an issue with some extra space at the bottom that disappears (corrects itself) when entering edit mode (it rarely happens), but there is so much more to test, so I'm handing that to you (and I'm doing the fix in the meantime). |
Summary
Relevant Technical Choices
To-do
User-facing changes
Text elements line-height works now more like a line-gap, there is no whitespace at the top of the first line and bottom of the last line.
Testing Instructions
Add text with 2+ lines of text and set line-height to 2+ (5+ to really see the difference with previous behavior).
Testing old stories:
How should it work?
Fixes #2788
Fixes #3530