[Merged by Bors] - make TextLayoutInfo a Component#4460
Closed
yrns wants to merge 3 commits intobevyengine:mainfrom
Closed
[Merged by Bors] - make TextLayoutInfo a Component#4460yrns wants to merge 3 commits intobevyengine:mainfrom
yrns wants to merge 3 commits intobevyengine:mainfrom
Conversation
Weibye
reviewed
Jun 12, 2022
Contributor
Weibye
left a comment
There was a problem hiding this comment.
I really like the change, the code looks good as far as I can tell :) Tiny comment before approving:
1d4c4f6 to
eca2452
Compare
alice-i-cecile
approved these changes
Aug 2, 2022
Contributor
Author
|
Brought this up-to-date with the main branch. I wish github displayed the diffs in such a way that it was clearer most of the changed lines are just indentation changes due to removing the surrounding |
Weibye
approved these changes
Aug 3, 2022
Member
|
More merge conflicts :( Sorry @yrns; I was on vacation. If you fix those up for us I'll merge it ASAP. |
Contributor
Author
|
Merged and tested the ui example. |
Member
|
Thanks! bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Sep 6, 2022
# Objective Make `TextLayoutInfo` more accessible as a component, rather than internal to `TextPipeline`. I am working on a plugin that manipulates these and there is no (mutable) access to them right now. ## Solution This changes `TextPipeline::queue_text` to return `TextLayoutInfo`'s rather than storing them in a map internally. `text2d_system` and `text_system` now take the returned `TextLayoutInfo` and store it as a component of the entity. I considered adding an accessor to `TextPipeline` (e.g. `get_glyphs_mut`) but this seems like it might be a little faster, and also has the added benefit of cleaning itself up when entities are removed. Right now nothing is ever removed from the glyphs map. ## Changelog Removed `DefaultTextPipeline`. `TextPipeline` no longer has a generic key type. `TextPipeline::queue_text` returns `TextLayoutInfo` directly. ## Migration Guide This might break a third-party crate? I could restore the orginal TextPipeline API as a wrapper around what's in this PR.
Contributor
|
Pull request successfully merged into main. Build succeeded: |
nicopap
pushed a commit
to nicopap/bevy
that referenced
this pull request
Sep 12, 2022
# Objective Make `TextLayoutInfo` more accessible as a component, rather than internal to `TextPipeline`. I am working on a plugin that manipulates these and there is no (mutable) access to them right now. ## Solution This changes `TextPipeline::queue_text` to return `TextLayoutInfo`'s rather than storing them in a map internally. `text2d_system` and `text_system` now take the returned `TextLayoutInfo` and store it as a component of the entity. I considered adding an accessor to `TextPipeline` (e.g. `get_glyphs_mut`) but this seems like it might be a little faster, and also has the added benefit of cleaning itself up when entities are removed. Right now nothing is ever removed from the glyphs map. ## Changelog Removed `DefaultTextPipeline`. `TextPipeline` no longer has a generic key type. `TextPipeline::queue_text` returns `TextLayoutInfo` directly. ## Migration Guide This might break a third-party crate? I could restore the orginal TextPipeline API as a wrapper around what's in this PR.
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 28, 2022
# Objective Make `TextLayoutInfo` more accessible as a component, rather than internal to `TextPipeline`. I am working on a plugin that manipulates these and there is no (mutable) access to them right now. ## Solution This changes `TextPipeline::queue_text` to return `TextLayoutInfo`'s rather than storing them in a map internally. `text2d_system` and `text_system` now take the returned `TextLayoutInfo` and store it as a component of the entity. I considered adding an accessor to `TextPipeline` (e.g. `get_glyphs_mut`) but this seems like it might be a little faster, and also has the added benefit of cleaning itself up when entities are removed. Right now nothing is ever removed from the glyphs map. ## Changelog Removed `DefaultTextPipeline`. `TextPipeline` no longer has a generic key type. `TextPipeline::queue_text` returns `TextLayoutInfo` directly. ## Migration Guide This might break a third-party crate? I could restore the orginal TextPipeline API as a wrapper around what's in this PR.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
# Objective Make `TextLayoutInfo` more accessible as a component, rather than internal to `TextPipeline`. I am working on a plugin that manipulates these and there is no (mutable) access to them right now. ## Solution This changes `TextPipeline::queue_text` to return `TextLayoutInfo`'s rather than storing them in a map internally. `text2d_system` and `text_system` now take the returned `TextLayoutInfo` and store it as a component of the entity. I considered adding an accessor to `TextPipeline` (e.g. `get_glyphs_mut`) but this seems like it might be a little faster, and also has the added benefit of cleaning itself up when entities are removed. Right now nothing is ever removed from the glyphs map. ## Changelog Removed `DefaultTextPipeline`. `TextPipeline` no longer has a generic key type. `TextPipeline::queue_text` returns `TextLayoutInfo` directly. ## Migration Guide This might break a third-party crate? I could restore the orginal TextPipeline API as a wrapper around what's in this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Make
TextLayoutInfomore accessible as a component, rather than internal toTextPipeline. I am working on a plugin that manipulates these and there is no (mutable) access to them right now.Solution
This changes
TextPipeline::queue_textto returnTextLayoutInfo's rather than storing them in a map internally.text2d_systemandtext_systemnow take the returnedTextLayoutInfoand store it as a component of the entity. I considered adding an accessor toTextPipeline(e.g.get_glyphs_mut) but this seems like it might be a little faster, and also has the added benefit of cleaning itself up when entities are removed. Right now nothing is ever removed from the glyphs map.Changelog
Removed
DefaultTextPipeline.TextPipelineno longer has a generic key type.TextPipeline::queue_textreturnsTextLayoutInfodirectly.Migration Guide
This might break a third-party crate? I could restore the orginal TextPipeline API as a wrapper around what's in this PR.