diff --git a/crates/bevy_ui/src/widget/image.rs b/crates/bevy_ui/src/widget/image.rs index 051a38769f..14a84484fb 100644 --- a/crates/bevy_ui/src/widget/image.rs +++ b/crates/bevy_ui/src/widget/image.rs @@ -27,10 +27,14 @@ pub fn image_node_system( .and_then(|material| material.texture.as_ref()) .and_then(|texture_handle| textures.get(texture_handle)) { - calculated_size.size = Size { + let size = Size { width: texture.size.width as f32, height: texture.size.height as f32, }; + // Update only if size has changed to avoid needless layout calculations + if size != calculated_size.size { + calculated_size.size = size; + } } } }