From 9247c5a23757e01ef7ee91dd5655fcab177e5e6d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Mar 2014 13:51:57 +0300 Subject: fix code style. --- src/gui/widgets/textbox.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/gui/widgets/textbox.cpp') diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index a00d0ccf8..5f565259b 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -65,8 +65,6 @@ #include "gui/widgets/textbox.h" -#include "events/keyevent.h" - #include "input/keydata.h" #include "gui/font.h" @@ -567,16 +565,13 @@ void TextBox::setCaretRowColumn(const int row, const int column) void TextBox::scrollToCaret() { + const Font *const font = getFont(); Rect scroll; - Font *const font = getFont(); - scroll.x = font->getWidth( - mTextRows[mCaretRow].substr(0, mCaretColumn)); + scroll.x = font->getWidth(mTextRows[mCaretRow].substr(0, mCaretColumn)); scroll.y = font->getHeight() * mCaretRow; scroll.width = font->getWidth(" "); - // add 2 for some extra space scroll.height = font->getHeight() + 2; - showPart(scroll); } @@ -619,7 +614,7 @@ void TextBox::drawCaret(Graphics *const graphics, const int x, const int y) void TextBox::adjustSize() { int width = 0; - Font *const font = getFont(); + const Font *const font = getFont(); for (size_t i = 0, sz = mTextRows.size(); i < sz; ++i) { const int w = font->getWidth(mTextRows[i]); -- cgit v1.2.3-60-g2f50