From 94c41840680afd414acb1195889bb88588901100 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 27 Mar 2021 03:03:47 +0000 Subject: [PATCH] Text responds to scale factor changes (#1769) Fixes #1768 If the scale factor changes, queue up all text to be drawn instead of just changed text. --- crates/bevy_ui/src/widget/text.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/bevy_ui/src/widget/text.rs b/crates/bevy_ui/src/widget/text.rs index f9e7dc8bc429d..a8dce7ea1a191 100644 --- a/crates/bevy_ui/src/widget/text.rs +++ b/crates/bevy_ui/src/widget/text.rs @@ -2,7 +2,7 @@ use crate::{CalculatedSize, Node, Style, Val}; use bevy_asset::Assets; use bevy_ecs::{ entity::Entity, - query::{Changed, Or, Without}, + query::{Changed, Or, With, Without}, system::{Local, Query, QuerySet, Res, ResMut}, }; use bevy_math::Size; @@ -45,6 +45,7 @@ pub fn text_constraint(min_size: Val, size: Val, max_size: Val, scale_factor: f6 #[allow(clippy::too_many_arguments)] pub fn text_system( mut queued_text: Local, + mut last_scale_factor: Local, mut textures: ResMut>, fonts: Res>, windows: Res, @@ -53,6 +54,7 @@ pub fn text_system( mut text_pipeline: ResMut, mut text_queries: QuerySet<( Query, Changed