aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextBox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/TextBox.cc')
-rw-r--r--src/FbTk/TextBox.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc
index 519b56e..1eec4eb 100644
--- a/src/FbTk/TextBox.cc
+++ b/src/FbTk/TextBox.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextBox.cc,v 1.3 2003/10/05 07:20:47 rathnor Exp $ 22// $Id: TextBox.cc,v 1.4 2003/12/16 17:06:52 fluxgen Exp $
23 23
24#include "TextBox.hh" 24#include "TextBox.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -254,11 +254,9 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
254} 254}
255 255
256void TextBox::setCursorPosition(int pos) { 256void TextBox::setCursorPosition(int pos) {
257 m_cursor_pos = pos; 257 m_cursor_pos = pos < 0 ? 0 : pos;
258 if (m_cursor_pos > text().size()) 258 if (m_cursor_pos > text().size())
259 cursorEnd(); 259 cursorEnd();
260 else if (m_cursor_pos < 0)
261 cursorHome();
262} 260}
263 261
264void TextBox::adjustEndPos() { 262void TextBox::adjustEndPos() {