-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
leading newline makes Text disappear #308
Comments
I think I've traced this issue to the It seems like there are a couple of routes forward:
I'm in favor of (2), but I think I've reached the point where I need to maintainer to make the final call on a design question. I can try to put a patch together for this once you've made a decision (or you can just go ahead and patch it yourself, I bet the fix will be pretty trivial if you decide to go with door number 2). |
Thanks for the detailed report and the SSCCEs! This is a really great bug report :D The current text rendering pipeline is relatively broken (see #33 and #243 (comment)), it has many similar issues, and it will need a full rewrite/replacement in the near future. Because of this, I believe it's better to tackle all the issues at once instead of investing time in trying to patch a broken model. |
* Import "debug" feature from iced in cargo.toml. F12 toggles debug. * Fix bug where last line of text wasn't showing in "status" panel. Starting the string with \n caused the last line not to show. See iced-rs/iced#308 Status messages are now stored as a vector of strings, rather than a big string.
* Import "debug" feature from iced in cargo.toml. F12 toggles debug. * Fix bug where last line of text wasn't showing in "status" panel. Starting the string with \n caused the last line not to show. See iced-rs/iced#308 Status messages are now stored as a vector of strings, rather than a big string.
Bug Description
When a string with a leading newline is passed to the Text widget, the text below that newline does not show up. It appears that this leading newline is not being included in some height computation because if there are multiple lines of text after a single leading newline, only the last line of text gets swallowed.
What did I Expect to Happen?
I would expect that leading newlines get included in the text that is displayed as well as all of the following text.
Minimal Example
Screenshot
Multi-line Example
Screenshot
More details about my system
$ uname -a Darwin ethanpailesmac 18.7.0 Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered: