summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/browserbox.cpp8
-rw-r--r--src/gui/widgets/textfield.cpp6
2 files changed, 5 insertions, 9 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);
}