-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Text strikethrough #21555
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
Text strikethrough #21555
Conversation
`TextLayoutInfo`.
Added example `strikeout`. Added draft release note.
…t valuesa after scalefactor changes and section updates.
Would it be possible to add the ability to change the size and color of the strikeout independent of the text? |
Yep it's really trivial even, just needs another component I left that and underline to followups to keep this PR focused on the basic implementation. |
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 is really a nit but I've never seen this called "strikeout" and always seen it referred to as "strikethrough".
@ickshonpe I did a bit of poking and I agree that "strikethrough" is more common. Can you rename that quick then I'll merge this? |
Yep, done. I wasn't sure about the naming either, but "strikeout" is what cosmic text uses internally. |
A quick Ctrl-F on GitHub showed ~12 occurrances of "strikeout" left, including in the release note file name. |
Thanks @copygirl @it-me-joda <3 |
# Objective Text Underline ## Solution New `Underline` marker component, add to text entities to draw an underline. This PR is based on #21555, that should probably be reviewed and merged first.
# Objective Add minimal strikethrough support for text. ## Solution * Insert the new `Strikethrough` component on any `Text`, `Text2d`, or `TextSpan` entity and its text will be drawn with strikethrough. * The strikethrough geometry is stored in `TextLayoutInfo` in the vec with the section bounding rects. * Rendering is trivial, identical to drawing text background colours except it's a narrower rect drawn in front instead of behind. * Text shadows also have strikethrough if the text does. # This implementation can easily be expanded to support underline, I've already made a follow up PR that does this here: bevyengine#21559. ## Testing ``` cargo run --example strikethrough ``` ## Showcase <img width="1422" height="924" alt="strikeout" src="https://github.com/user-attachments/assets/c8ea2578-e40c-4c46-ae0d-df9e3f261f3a" />
Objective
Add minimal strikethrough support for text.
Solution
Strikethrough
component on anyText
,Text2d
, orTextSpan
entity and its text will be drawn with strikethrough.TextLayoutInfo
in the vec with the section bounding rects.This implementation can easily be expanded to support underline, I've already made a follow up PR that does this here: #21559.
Testing
Showcase