diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-10 20:24:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-10 20:57:14 +0300 |
commit | dba5ec4c1f249599a5f718fe4e532c66e917ffa9 (patch) | |
tree | 93f7147d25d8d99d15c579f4f3f58c961c120def | |
parent | a99352987c2a48012dccd6aeb6c6474b9fce1bdd (diff) | |
download | manaplus-dba5ec4c1f249599a5f718fe4e532c66e917ffa9.tar.gz manaplus-dba5ec4c1f249599a5f718fe4e532c66e917ffa9.tar.bz2 manaplus-dba5ec4c1f249599a5f718fe4e532c66e917ffa9.tar.xz manaplus-dba5ec4c1f249599a5f718fe4e532c66e917ffa9.zip |
Remove some push/pop clip areas.
-rw-r--r-- | src/graphics.cpp | 24 | ||||
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 10 |
2 files changed, 13 insertions, 21 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 61f98b2a7..37fd72c08 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -346,7 +346,7 @@ void Graphics::drawImageRect(int x, int y, int w, int h, Image *bottom, Image *left, Image *center) { - pushClipArea(gcn::Rectangle(x, y, w, h)); +// pushClipArea(gcn::Rectangle(x, y, w, h)); const bool drawMain = center && topLeft && topRight && bottomLeft && bottomRight; @@ -355,7 +355,7 @@ void Graphics::drawImageRect(int x, int y, int w, int h, if (center && drawMain) { drawImagePattern(center, - topLeft->getWidth(), topLeft->getHeight(), + topLeft->getWidth() + x, topLeft->getHeight() + y, w - topLeft->getWidth() - topRight->getWidth(), h - topLeft->getHeight() - bottomLeft->getHeight()); } @@ -364,18 +364,18 @@ void Graphics::drawImageRect(int x, int y, int w, int h, if (top && left && bottom && right) { drawImagePattern(top, - left->getWidth(), 0, + x + left->getWidth(), y, w - left->getWidth() - right->getWidth(), top->getHeight()); drawImagePattern(bottom, - left->getWidth(), h - bottom->getHeight(), + x + left->getWidth(), h - bottom->getHeight() + y, w - left->getWidth() - right->getWidth(), bottom->getHeight()); drawImagePattern(left, - 0, top->getHeight(), + x, y + top->getHeight(), left->getWidth(), h - top->getHeight() - bottom->getHeight()); drawImagePattern(right, - w - right->getWidth(), top->getHeight(), + x + w - right->getWidth(), top->getHeight() + y, right->getWidth(), h - top->getHeight() - bottom->getHeight()); } @@ -383,15 +383,15 @@ void Graphics::drawImageRect(int x, int y, int w, int h, // Draw the corners if (drawMain) { - drawImage(topLeft, 0, 0); - drawImage(topRight, w - topRight->getWidth(), 0); - drawImage(bottomLeft, 0, h - bottomLeft->getHeight()); + drawImage(topLeft, x, y); + drawImage(topRight, x + w - topRight->getWidth(), y); + drawImage(bottomLeft, x, h - bottomLeft->getHeight() + y); drawImage(bottomRight, - w - bottomRight->getWidth(), - h - bottomRight->getHeight()); + x + w - bottomRight->getWidth(), + y + h - bottomRight->getHeight()); } - popClipArea(); +// popClipArea(); } void Graphics::drawImageRect(int x, int y, int w, int h, diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index e641be323..feedeae7b 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -136,23 +136,16 @@ void RadioButton::drawBox(gcn::Graphics* graphics) } if (box) - static_cast<Graphics*>(graphics)->drawImage(box, 2, 2); + static_cast<Graphics*>(graphics)->drawImage(box, 3, 3); } void RadioButton::draw(gcn::Graphics* graphics) { - graphics->pushClipArea(gcn::Rectangle(1, 1, getWidth() - 1, - getHeight() - 1)); - drawBox(graphics); - graphics->popClipArea(); - graphics->setFont(getFont()); graphics->setColor(getForegroundColor()); -// int h = getHeight() + getHeight() / 2; -// graphics->drawText(getCaption(), h - 2, 0); graphics->drawText(getCaption(), 16, 0); } @@ -165,4 +158,3 @@ void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED) { mHasMouse = false; } - |