1
0
Fork 0

Merge pull request #106915 from KoBeWi/invalid_reservation

Fix `SCROLL_MODE_RESERVE` with RTL layout
This commit is contained in:
Rémi Verschelde 2025-06-01 00:31:50 +02:00
commit 626a75abb1
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 2 deletions

View File

@ -364,12 +364,13 @@ void ScrollContainer::_reposition_children() {
}
bool rtl = is_layout_rtl();
bool reserve_vscroll = _is_v_scroll_visible() || vertical_scroll_mode == SCROLL_MODE_RESERVE;
if (_is_h_scroll_visible() || horizontal_scroll_mode == SCROLL_MODE_RESERVE) {
size.y -= h_scroll->get_minimum_size().y;
}
if (_is_v_scroll_visible() || vertical_scroll_mode == SCROLL_MODE_RESERVE) {
if (reserve_vscroll) {
size.x -= v_scroll->get_minimum_size().x;
}
@ -391,7 +392,7 @@ void ScrollContainer::_reposition_children() {
r.size.height = MAX(size.height, minsize.height);
}
r.position += ofs;
if (rtl && _is_v_scroll_visible()) {
if (rtl && reserve_vscroll) {
r.position.x += v_scroll->get_minimum_size().x;
}
r.position = r.position.floor();