summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index b655de830..b1d188f22 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -137,7 +137,7 @@ void TextField::updateAlpha()
}
}
-void TextField::draw(gcn::Graphics *graphics)
+void TextField::draw(Graphics *graphics)
{
BLOCK_START("TextField::draw")
updateAlpha();
@@ -155,7 +155,7 @@ void TextField::draw(gcn::Graphics *graphics)
BLOCK_END("TextField::draw")
}
-void TextField::drawFrame(gcn::Graphics *graphics)
+void TextField::drawFrame(Graphics *graphics)
{
BLOCK_START("TextField::drawFrame")
const int bs = 2 * mFrameSize;
@@ -661,12 +661,14 @@ void TextField::handleCopy() const
sendBuffer(text);
}
-void TextField::drawCaret(gcn::Graphics* graphics, int x)
+void TextField::drawCaret(Graphics* graphics, int x)
{
- const gcn::Rectangle &clipArea = graphics->getCurrentClipArea();
+ const gcn::Rectangle *const clipArea = graphics->getCurrentClipArea();
+ if (!clipArea)
+ return;
graphics->setColor(*mCaretColor);
- graphics->drawLine(x + mPadding, clipArea.height - mPadding,
+ graphics->drawLine(x + mPadding, clipArea->height - mPadding,
x + mPadding, mPadding);
}