mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 14:40:19 +00:00
measure_text_system
text query fix (#8466)
# Objective The first query of `measure_text_system`'s `text_queries` `ParamSet` queries for all changed `Text` meaning that non-UI `Text` entities could be added to its queue. ## Solution Add a `With<Node>` query filter. --- ## Changelog changes: * Added a `With<Node>` query filter to first query of `measure_text_system`'s `text_queries` `ParamSet` to ensure that only UI node entities are added to its local queue. * Fixed comment (text is not computed on changes to style).
This commit is contained in:
parent
15a96adc01
commit
4580a91171
1 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ pub fn measure_text_system(
|
||||||
ui_scale: Res<UiScale>,
|
ui_scale: Res<UiScale>,
|
||||||
mut text_pipeline: ResMut<TextPipeline>,
|
mut text_pipeline: ResMut<TextPipeline>,
|
||||||
mut text_queries: ParamSet<(
|
mut text_queries: ParamSet<(
|
||||||
Query<Entity, Changed<Text>>,
|
Query<Entity, (Changed<Text>, With<Node>)>,
|
||||||
Query<Entity, (With<Text>, With<Node>)>,
|
Query<Entity, (With<Text>, With<Node>)>,
|
||||||
Query<(&Text, &mut CalculatedSize)>,
|
Query<(&Text, &mut CalculatedSize)>,
|
||||||
)>,
|
)>,
|
||||||
|
@ -82,7 +82,7 @@ pub fn measure_text_system(
|
||||||
|
|
||||||
#[allow(clippy::float_cmp)]
|
#[allow(clippy::float_cmp)]
|
||||||
if *last_scale_factor == scale_factor {
|
if *last_scale_factor == scale_factor {
|
||||||
// Adds all entities where the text or the style has changed to the local queue
|
// Adds all entities where the text has changed to the local queue
|
||||||
for entity in text_queries.p0().iter() {
|
for entity in text_queries.p0().iter() {
|
||||||
if !queued_text.contains(&entity) {
|
if !queued_text.contains(&entity) {
|
||||||
queued_text.push(entity);
|
queued_text.push(entity);
|
||||||
|
|
Loading…
Reference in a new issue