diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-13 22:23:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-13 22:23:22 +0300 |
commit | 362f35430a2edd76885f6cd8f3e4565260d2101a (patch) | |
tree | 22d8092d1611f252abdeaf09fc342628f1d87da1 /src | |
parent | aa03bdb26c736e7d506d656a5529cf6a4e9fe6b4 (diff) | |
download | mv-362f35430a2edd76885f6cd8f3e4565260d2101a.tar.gz mv-362f35430a2edd76885f6cd8f3e4565260d2101a.tar.bz2 mv-362f35430a2edd76885f6cd8f3e4565260d2101a.tar.xz mv-362f35430a2edd76885f6cd8f3e4565260d2101a.zip |
Remove duplicate function from graphics.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/textfield.cpp | 6 | ||||
-rw-r--r-- | src/render/graphics.cpp | 8 | ||||
-rw-r--r-- | src/render/graphics.h | 8 |
4 files changed, 5 insertions, 25 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 4862e07a3..fdb528cea 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -473,11 +473,9 @@ void BrowserBox::mouseExited(MouseEvent &event A_UNUSED) void BrowserBox::draw(Graphics *graphics) { BLOCK_START("BrowserBox::draw") - const ClipRect *const cr = graphics->getCurrentClipArea(); - if (!cr) - return; - mYStart = cr->y - cr->yOffset; - const int yEnd = mYStart + cr->height; + const ClipRect &cr = graphics->getTopClip(); + mYStart = cr.y - cr.yOffset; + const int yEnd = mYStart + cr.height; if (mYStart < 0) mYStart = 0; diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 22e5b649f..8f615fc70 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -634,12 +634,10 @@ void TextField::handleCopy() const void TextField::drawCaret(Graphics* graphics, int x) { - const Rect *const clipArea = graphics->getCurrentClipArea(); - if (!clipArea) - return; + const ClipRect &clipArea = graphics->getTopClip(); graphics->setColor(*mCaretColor); - graphics->drawLine(x + mPadding, clipArea->height - mPadding, + graphics->drawLine(x + mPadding, clipArea.height - mPadding, x + mPadding, mPadding); } diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 4542a33ae..63ce578e4 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -639,14 +639,6 @@ void Graphics::popClipArea() mClipStack.pop(); } -const ClipRect *Graphics::getCurrentClipArea() const -{ - if (mClipStack.empty()) - return nullptr; - - return &mClipStack.topConst(); -} - #ifdef USE_OPENGL void Graphics::setOpenGLFlags() { diff --git a/src/render/graphics.h b/src/render/graphics.h index c43471f66..62a3848d7 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -409,14 +409,6 @@ class Graphics notfinal */ virtual void drawRectangle(const Rect &rectangle) = 0; - /** - * Gets the current clip area. Usefull if you want to do drawing - * bypassing Graphics. - * - * @return The current clip area. - */ - virtual const ClipRect *getCurrentClipArea() const; - #ifdef USE_OPENGL virtual void createGLContext(); #endif |