We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32acbfb commit 5edf2d2Copy full SHA for 5edf2d2
crates/bevy_ui/src/widget/image.rs
@@ -27,10 +27,14 @@ pub fn image_node_system(
27
.and_then(|material| material.texture.as_ref())
28
.and_then(|texture_handle| textures.get(texture_handle))
29
{
30
- calculated_size.size = Size {
+ let size = Size {
31
width: texture.size.width as f32,
32
height: texture.size.height as f32,
33
};
34
+ // Update only if size has changed to avoid needless layout calculations
35
+ if size != calculated_size.size {
36
+ calculated_size.size = size;
37
+ }
38
}
39
40
0 commit comments