Browse Source

Fix to fit stylebox with ItemList

(cherry picked from commit 4c9b00b5085c0ab9195842f9a0cf2287d9242bbe)
volzhs 8 years ago
parent
commit
7c92b401f1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      scene/gui/item_list.cpp

+ 4 - 1
scene/gui/item_list.cpp

@@ -801,7 +801,10 @@ void ItemList::_notification(int p_what) {
 		Size2 size = get_size();
 		Size2 size = get_size();
 
 
 		float page = size.height-bg->get_minimum_size().height;
 		float page = size.height-bg->get_minimum_size().height;
-		int width = size.width - mw - bg->get_minimum_size().width;
+		int width = size.width-bg->get_minimum_size().width;
+		if (!scroll_bar->is_hidden()){
+			width-=mw+bg->get_margin(MARGIN_RIGHT);
+		}
 		scroll_bar->set_page(page);
 		scroll_bar->set_page(page);
 
 
 		draw_style_box(bg,Rect2(Point2(),size));
 		draw_style_box(bg,Rect2(Point2(),size));