mirror of
https://github.com/bevyengine/bevy
synced 2024-11-13 00:17:27 +00:00
Move ContentSize
requirements from Node
to the widget defining components (#16083)
# Objective 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. ## Solution 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
c4c1c8ffa1
commit
78a4bea3d7
2 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::{ContentSize, FocusPolicy, UiRect, Val};
|
||||
use crate::{FocusPolicy, UiRect, Val};
|
||||
use bevy_color::Color;
|
||||
use bevy_ecs::{prelude::*, system::SystemParam};
|
||||
use bevy_math::{vec4, Rect, Vec2, Vec4Swizzles};
|
||||
|
@ -286,7 +286,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 a new issue