From 33a93311ec9933f4f5ef5688f768ec3ecef5cc82 Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Sat, 14 Jul 2018 14:02:08 +0100 Subject: [PATCH] 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. (cherry picked from commit e51a94905d4b866475c16fe1a2b20a7db5d61e81) --- scene/gui/scroll_bar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 00184578d59..d946424d0fa 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -271,9 +271,7 @@ void ScrollBar::_notification(int p_what) { 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) ofs.x += decr->get_width(); @@ -294,7 +292,7 @@ void ScrollBar::_notification(int p_what) { else 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; if (orientation == HORIZONTAL) {