mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-23 17:47:17 +01:00
Fix ItemList
selection visual when the scrollbar visibility changes
(cherry picked from commit e298144a41338d80b5f0090ce8f28aef888c13dd)
This commit is contained in:
parent
73588d4a25
commit
db8e21638a
@ -755,11 +755,7 @@ void ItemList::_notification(int p_what) {
|
|||||||
scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -bg->get_margin(MARGIN_BOTTOM));
|
scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -bg->get_margin(MARGIN_BOTTOM));
|
||||||
|
|
||||||
Size2 size = get_size();
|
Size2 size = get_size();
|
||||||
|
|
||||||
int width = size.width - bg->get_minimum_size().width;
|
int width = size.width - bg->get_minimum_size().width;
|
||||||
if (scroll_bar->is_visible()) {
|
|
||||||
width -= mw;
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_style_box(bg, Rect2(Point2(), size));
|
draw_style_box(bg, Rect2(Point2(), size));
|
||||||
|
|
||||||
@ -918,6 +914,10 @@ void ItemList::_notification(int p_what) {
|
|||||||
shape_changed = false;
|
shape_changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scroll_bar->is_visible()) {
|
||||||
|
width -= mw;
|
||||||
|
}
|
||||||
|
|
||||||
//ensure_selected_visible needs to be checked before we draw the list.
|
//ensure_selected_visible needs to be checked before we draw the list.
|
||||||
if (ensure_selected_visible && current >= 0 && current < items.size()) {
|
if (ensure_selected_visible && current >= 0 && current < items.size()) {
|
||||||
Rect2 r = items[current].rect_cache;
|
Rect2 r = items[current].rect_cache;
|
||||||
|
Loading…
Reference in New Issue
Block a user