You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #106915 from KoBeWi/invalid_reservation
Fix `SCROLL_MODE_RESERVE` with RTL layout
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user