Skip to content

Commit

Permalink
do not spend time drawing text with is_visible = false (#893)
Browse files Browse the repository at this point in the history
do not draw text with is_visible = false
  • Loading branch information
marius8510000-bot authored Nov 22, 2020
1 parent 1e9a054 commit eb587b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_ui/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ pub fn draw_text_system(
let vertex_buffer_descriptor = font_quad.get_vertex_buffer_descriptor();

for (entity, mut draw, text, node, global_transform) in query.iter_mut() {
if !draw.is_visible {
continue;
}

if let Some(text_glyphs) = text_pipeline.get_glyphs(&entity) {
let position = global_transform.translation - (node.size / 2.0).extend(0.0);

Expand Down

0 comments on commit eb587b2

Please sign in to comment.