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

register TextLayoutInfo and TextFlags type. #9919

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

ycysdf
Copy link
Contributor

@ycysdf ycysdf commented Sep 25, 2023

derive Reflect to GlyphAtlasInfo,PositionedGlyph and TextLayoutInfo.

Objective

  • I need reflection gets all components of the TextBundle and clone_value it

Solution

  • registry it

derive `Reflect` to `GlyphAtlasInfo`,`PositionedGlyph` and `TextLayoutInfo`.
@ycysdf ycysdf changed the title register type TextLayoutInfo and TextFlags. register TextLayoutInfo and TextFlags type. Sep 25, 2023
@@ -13,6 +13,7 @@ pub mod widget;

use bevy_derive::{Deref, DerefMut};
use bevy_reflect::Reflect;
use bevy_text::TextLayoutInfo;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
use bevy_text::TextLayoutInfo;
#[cfg(feature = "bevy_text")]
use bevy_text::TextLayoutInfo;

Comment on lines 94 to 95
.register_type::<TextLayoutInfo>()
.register_type::<TextFlags>()
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to add those conditionally.

To check your changes, use the cargo check -p bevy_ui --no-default-features command

@nicopap
Copy link
Contributor

nicopap commented Sep 25, 2023

I also need this, I'd like if this got merged. Could you please address the comments?

@ycysdf
Copy link
Contributor Author

ycysdf commented Sep 25, 2023

I also need this, I'd like if this got merged. Could you please address the comments?

Ok.

Copy link
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

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

Looks good, works correctly with the text feature disabled.

This wasn't done before because when I implemented TextFlags I was still afraid of touching anything to do with reflection 😅

The UI example and Text with scale factor is broken again 😓 but it's broken in Main as well so nothing to do with this PR.

@nicopap nicopap added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-Reflection Runtime information about types labels Sep 25, 2023
@mockersf mockersf added this pull request to the merge queue Sep 25, 2023
Merged via the queue into bevyengine:main with commit 35de5e6 Sep 25, 2023
25 checks passed
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
derive `Reflect` to `GlyphAtlasInfo`,`PositionedGlyph` and
`TextLayoutInfo`.

# Objective

- I need reflection gets all components of the `TextBundle` and
`clone_value` it

## Solution

- registry it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants