瀏覽代碼

fix scrollbar icons with atlas texture.

Draw scrollbar icons through their textures, rather than calling
directly to the server. Allows atlas textures to manipulate the source
rect as required.
Ibrahn Sahir 7 年之前
父節點
當前提交
e51a94905d
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      scene/gui/scroll_bar.cpp

+ 2 - 4
scene/gui/scroll_bar.cpp

@@ -257,9 +257,7 @@ void ScrollBar::_notification(int p_what) {
 
 
 		Point2 ofs;
 		Point2 ofs;
 
 
-		VisualServer *vs = VisualServer::get_singleton();
-
-		vs->canvas_item_add_texture_rect(ci, Rect2(Point2(), decr->get_size()), decr->get_rid());
+		decr->draw(ci, Point2());
 
 
 		if (orientation == HORIZONTAL)
 		if (orientation == HORIZONTAL)
 			ofs.x += decr->get_width();
 			ofs.x += decr->get_width();
@@ -280,7 +278,7 @@ void ScrollBar::_notification(int p_what) {
 		else
 		else
 			ofs.height += area.height;
 			ofs.height += area.height;
 
 
-		vs->canvas_item_add_texture_rect(ci, Rect2(ofs, decr->get_size()), incr->get_rid());
+		incr->draw(ci, ofs);
 		Rect2 grabber_rect;
 		Rect2 grabber_rect;
 
 
 		if (orientation == HORIZONTAL) {
 		if (orientation == HORIZONTAL) {