mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Text2d doesn't recompute text on changes to the text's bounds (#7846)
# Objective Text2d entity's text needs to be recomputed when their bounds are changed, but it isn't. # Solution Change `update_text2d_layout` to query for `Ref<Text2dBounds>` and recompute the text if the bounds have changed.
This commit is contained in:
parent
9e6ad4607f
commit
f732172c73
1 changed files with 2 additions and 2 deletions
|
@ -168,7 +168,7 @@ pub fn update_text2d_layout(
|
|||
mut text_query: Query<(
|
||||
Entity,
|
||||
Ref<Text>,
|
||||
&Text2dBounds,
|
||||
Ref<Text2dBounds>,
|
||||
Option<&mut TextLayoutInfo>,
|
||||
)>,
|
||||
) {
|
||||
|
@ -182,7 +182,7 @@ pub fn update_text2d_layout(
|
|||
.unwrap_or(1.0);
|
||||
|
||||
for (entity, text, bounds, text_layout_info) in &mut text_query {
|
||||
if factor_changed || text.is_changed() || queue.remove(&entity) {
|
||||
if factor_changed || text.is_changed() || bounds.is_changed() || queue.remove(&entity) {
|
||||
let text_bounds = Vec2::new(
|
||||
scale_value(bounds.size.x, scale_factor),
|
||||
scale_value(bounds.size.y, scale_factor),
|
||||
|
|
Loading…
Reference in a new issue