Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ impl ComputedNode {
/// Returns the combined inset on each edge including both padding and border thickness in physical pixels.
#[inline]
pub fn content_inset(&self) -> BorderRect {
self.border + self.padding
let mut content_inset = self.border + self.padding;
content_inset.right += self.scrollbar_size.x;
content_inset.bottom += self.scrollbar_size.y;
content_inset
}

/// Returns the inverse of the scale factor for this node.
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ui/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ fn update_clipping(

clip_rect.min.x += clip_inset.left;
clip_rect.min.y += clip_inset.top;
clip_rect.max.x -= clip_inset.right + computed_node.scrollbar_size.x;
clip_rect.max.y -= clip_inset.bottom + computed_node.scrollbar_size.y;
clip_rect.max.x -= clip_inset.right;
clip_rect.max.y -= clip_inset.bottom;

clip_rect = clip_rect
.inflate(node.overflow_clip_margin.margin.max(0.) / computed_node.inverse_scale_factor);
Expand Down