Fix SCROLL_MODE_RESERVE with RTL layout

This commit is contained in:
kobewi
2025-05-28 23:24:27 +02:00
parent 2cde9292c3
commit df70765af0

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();