Skip to content

Commit 25a6239

Browse files
committed
Merge pull request #112396 from sockeye-d/fix-scrollbar-margin-min-size
Make ScrollContainer scrollbar margins affect minimum size
2 parents dca2986 + d2c3fda commit 25a6239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/scroll_container.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ Size2 ScrollContainer::get_minimum_size() const {
6161
min_size.x = largest_child_min_size.x;
6262
bool v_scroll_show = vertical_scroll_mode == SCROLL_MODE_SHOW_ALWAYS || vertical_scroll_mode == SCROLL_MODE_RESERVE || (vertical_scroll_mode == SCROLL_MODE_AUTO && largest_child_min_size.y > size.y);
6363
if (v_scroll_show && v_scroll->get_parent() == this) {
64-
min_size.x += v_scroll->get_minimum_size().x;
64+
min_size.x += v_scroll->get_minimum_size().x + theme_cache.scrollbar_h_separation;
6565
}
6666
}
6767

6868
if (vertical_scroll_mode == SCROLL_MODE_DISABLED) {
6969
min_size.y = largest_child_min_size.y;
7070
bool h_scroll_show = horizontal_scroll_mode == SCROLL_MODE_SHOW_ALWAYS || horizontal_scroll_mode == SCROLL_MODE_RESERVE || (horizontal_scroll_mode == SCROLL_MODE_AUTO && largest_child_min_size.x > size.x);
7171
if (h_scroll_show && h_scroll->get_parent() == this) {
72-
min_size.y += h_scroll->get_minimum_size().y;
72+
min_size.y += h_scroll->get_minimum_size().y + theme_cache.scrollbar_v_separation;
7373
}
7474
}
7575

0 commit comments

Comments
 (0)