Преглед изворни кода

Merge pull request #64711 from YeldhamDev/itemlist_scroll_fix

Rémi Verschelde пре 3 година
родитељ
комит
99548e521d
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      scene/gui/item_list.cpp

+ 4 - 4
scene/gui/item_list.cpp

@@ -932,11 +932,7 @@ void ItemList::_notification(int p_what) {
 			scroll_bar->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, -bg->get_margin(SIDE_BOTTOM));
 
 			Size2 size = get_size();
-
 			int width = size.width - bg->get_minimum_size().width;
-			if (scroll_bar->is_visible()) {
-				width -= mw;
-			}
 
 			draw_style_box(bg, Rect2(Point2(), size));
 
@@ -1095,6 +1091,10 @@ void ItemList::_notification(int p_what) {
 				shape_changed = false;
 			}
 
+			if (scroll_bar->is_visible()) {
+				width -= mw;
+			}
+
 			//ensure_selected_visible needs to be checked before we draw the list.
 			if (ensure_selected_visible && current >= 0 && current < items.size()) {
 				Rect2 r = items[current].rect_cache;