From 696a646491afcaf27f76cf976d4987e88cec50a2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Sep 2013 22:11:48 +0300 Subject: improve draw speed in tab. --- src/gui/widgets/tab.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index f1dc59c60..643a5ff92 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -231,6 +231,16 @@ void Tab::draw(gcn::Graphics *graphics) mVertexes->clear(); g->calcWindow(mVertexes, 0, 0, mDimension.width, mDimension.height, rect); + + if (mImage) + { + const Skin *const skin1 = tabImg[TAB_STANDARD]; + if (skin1) + { + const int padding = skin1->getPadding(); + g->calcTile(mVertexes, mImage, padding, padding); + } + } } g->drawTile(mVertexes); @@ -239,16 +249,15 @@ void Tab::draw(gcn::Graphics *graphics) { g->drawImageRect(0, 0, mDimension.width, mDimension.height, skin->getBorder()); - } - } - - if (mImage) - { - const Skin *const skin1 = tabImg[TAB_STANDARD]; - if (skin1) - { - const int padding = skin1->getPadding(); - g->drawImage(mImage, padding, padding); + if (mImage) + { + const Skin *const skin1 = tabImg[TAB_STANDARD]; + if (skin1) + { + const int padding = skin1->getPadding(); + g->drawImage(mImage, padding, padding); + } + } } } -- cgit v1.2.3-70-g09d2