Move ContentSize
requirements from Node
to the widget defining components (#16083)
Missed this in the required components PR review. `ContentSize` isn't used by regular UI nodes, only those with intrinsically sized content that needs a measure func. Remove `ContentSize` from `Node`'s required components and add it to the required components of `Text` and `UiImage`. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
013a18b648
commit
dfd3d61aae
@ -1,4 +1,4 @@
|
||||
use crate::{widget::UiImageSize, ContentSize, FocusPolicy, UiRect, Val};
|
||||
use crate::{widget::UiImageSize, FocusPolicy, UiRect, Val};
|
||||
use bevy_asset::Handle;
|
||||
use bevy_color::Color;
|
||||
use bevy_ecs::{prelude::*, system::SystemParam};
|
||||
@ -288,7 +288,6 @@ impl From<&Vec2> for ScrollPosition {
|
||||
BackgroundColor,
|
||||
BorderColor,
|
||||
BorderRadius,
|
||||
ContentSize,
|
||||
FocusPolicy,
|
||||
ScrollPosition,
|
||||
Transform,
|
||||
|
@ -102,7 +102,7 @@ pub struct TextBundle {}
|
||||
/// ```
|
||||
#[derive(Component, Debug, Default, Clone, Deref, DerefMut, Reflect)]
|
||||
#[reflect(Component, Default, Debug)]
|
||||
#[require(Node, TextLayout, TextFont, TextColor, TextNodeFlags)]
|
||||
#[require(Node, TextLayout, TextFont, TextColor, TextNodeFlags, ContentSize)]
|
||||
pub struct Text(pub String);
|
||||
|
||||
impl Text {
|
||||
|
Loading…
Reference in New Issue
Block a user