Skip to content

Commit

Permalink
Revert "Fix scroll bar position (emilk#392)" (emilk#458)
Browse files Browse the repository at this point in the history
This reverts commit 2932ff0.
  • Loading branch information
emilk authored Jun 3, 2021
1 parent ec6268e commit 2af86cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ impl ScrollArea {
),
*ui.layout(),
);
let content_clip_rect = inner_rect
.expand(ui.visuals().clip_rect_margin)
.intersect(ui.clip_rect());
let mut content_clip_rect = inner_rect.expand(ui.visuals().clip_rect_margin);
content_clip_rect = content_clip_rect.intersect(ui.clip_rect());
content_clip_rect.max.x = ui.clip_rect().max.x - current_scroll_bar_width; // Nice handling of forced resizing beyond the possible
content_ui.set_clip_rect(content_clip_rect);

let viewport = Rect::from_min_size(Pos2::ZERO + state.offset, inner_size);
Expand Down Expand Up @@ -251,7 +251,7 @@ impl Prepared {
}

let width = if inner_rect.width().is_finite() {
inner_rect.width() // Position scroll bar correctly
inner_rect.width().max(content_size.x) // Expand width to fit content
} else {
// ScrollArea is in an infinitely wide parent
content_size.x
Expand Down

0 comments on commit 2af86cd

Please sign in to comment.