Skip to content

Commit 626a75a

Browse files
committed
Merge pull request #106915 from KoBeWi/invalid_reservation
Fix `SCROLL_MODE_RESERVE` with RTL layout
2 parents 2df41d8 + df70765 commit 626a75a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scene/gui/scroll_container.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,13 @@ void ScrollContainer::_reposition_children() {
364364
}
365365

366366
bool rtl = is_layout_rtl();
367+
bool reserve_vscroll = _is_v_scroll_visible() || vertical_scroll_mode == SCROLL_MODE_RESERVE;
367368

368369
if (_is_h_scroll_visible() || horizontal_scroll_mode == SCROLL_MODE_RESERVE) {
369370
size.y -= h_scroll->get_minimum_size().y;
370371
}
371372

372-
if (_is_v_scroll_visible() || vertical_scroll_mode == SCROLL_MODE_RESERVE) {
373+
if (reserve_vscroll) {
373374
size.x -= v_scroll->get_minimum_size().x;
374375
}
375376

@@ -391,7 +392,7 @@ void ScrollContainer::_reposition_children() {
391392
r.size.height = MAX(size.height, minsize.height);
392393
}
393394
r.position += ofs;
394-
if (rtl && _is_v_scroll_visible()) {
395+
if (rtl && reserve_vscroll) {
395396
r.position.x += v_scroll->get_minimum_size().x;
396397
}
397398
r.position = r.position.floor();

0 commit comments

Comments
 (0)