Skip to content

Commit

Permalink
Fix tilepicker being too wide by default
Browse files Browse the repository at this point in the history
In egui 0.24, the scrollbars no longer take up any space by default and
only appear when you hover over where the scrollbar is supposed to be.
So since Astrabit-ST#75, the tilepicker width was incorrectly
including the width of the scrollbar in the width calculation, making
the tilepicker too wide. This removes the width of the scrollbar from
the tilepicker width formula so that the tilepicker default width and
maximum width are calculated correctly.
  • Loading branch information
white-axe committed Dec 13, 2023
1 parent b189726 commit d4ee92e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/ui/src/tabs/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,7 @@ impl luminol_core::Tab for Tab {

// Display the tilepicker.
let spacing = ui.spacing();
let tilepicker_default_width = 256.
+ spacing.indent
+ spacing.scroll.bar_inner_margin
+ spacing.scroll.bar_width
+ spacing.scroll.bar_outer_margin;
let tilepicker_default_width = 256. + spacing.indent;
egui::SidePanel::left(format!("map_{}_tilepicker", self.id))
.default_width(tilepicker_default_width)
.max_width(tilepicker_default_width)
Expand Down

0 comments on commit d4ee92e

Please sign in to comment.