Skip to content
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

Some text_editor QoL #2358

Merged
merged 1 commit into from
Apr 2, 2024
Merged

Conversation

bungoboingo
Copy link
Contributor

@bungoboingo bungoboingo commented Mar 29, 2024

  • Exposed the text_size & line_height fields in TextEditor
  • "Fixed" an issue with cosmic_text Wrap::Word which will not fall back to glyph in cases of very long words

@bungoboingo
Copy link
Contributor Author

bungoboingo commented Mar 30, 2024

Word wrapping issue:

word_wrapping.mov

(Issue is known: pop-os/cosmic-text#219)

After explicitly changing the wrap mode to "Glyph" we no longer overflow text buffer bounds in certain cases.

glyph_wrapping.mov

I believe this is better than using Wrap::Word since it removes some jank. Can go back to using default Word when this issue is fixed on cosmic_text side.

@bungoboingo bungoboingo changed the title Expose line_height & text_size fields for the text_editor widget Some text_editor QoL Mar 30, 2024
@hojjatabdollahi
Copy link

How does Wrap::Glyph wrap a normal sentence? Doesn't it just break the last word?

graphics/src/text/editor.rs Outdated Show resolved Hide resolved
@hecrj
Copy link
Member

hecrj commented Mar 30, 2024

It seems a fix may have been released in the latest cosmic-text version (pop-os/cosmic-text#219 (comment)).

I plan to update soon.

@hecrj hecrj added bug Something isn't working text widget layout fix labels Mar 30, 2024
@hecrj hecrj added this to the 0.13 milestone Mar 30, 2024
@bungoboingo
Copy link
Contributor Author

I've reverted the last commit, just now just exposing those two methods 👍 Hopefully this is fixed in cosmic-text!

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🥳

@hecrj hecrj merged commit b17f890 into iced-rs:master Apr 2, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants