Skip to content

Commit

Permalink
fix negative ui scale
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Aug 12, 2024
1 parent af6acc4 commit c89ef89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Node {
/// Returns the logical pixel coordinates of the UI node, based on its [`GlobalTransform`].
#[inline]
pub fn logical_rect(&self, transform: &GlobalTransform) -> Rect {
Rect::from_center_size(transform.translation().truncate(), self.size())
Rect::from_center_size(transform.translation().truncate(), self.size().max(Vec2::ZERO))
}

/// Returns the physical pixel coordinates of the UI node, based on its [`GlobalTransform`] and the scale factor.
Expand Down

0 comments on commit c89ef89

Please sign in to comment.