From 15121d706349ac2cd8acf0bfb4abc5671e02d91a Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 15 Mar 2014 20:24:32 +0100 Subject: [PATCH] Fix a possible refresh issue in the text boxes. When delete_selection deletes text and insert char doesn't insert anything the widget was not properly updated. The bug was mainly theoretical in nature. --- src/gui/widgets/text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/text.cpp b/src/gui/widgets/text.cpp index b96f77ca0368..4c6c93cc0f77 100644 --- a/src/gui/widgets/text.cpp +++ b/src/gui/widgets/text.cpp @@ -132,12 +132,12 @@ void ttext_::insert_char(const Uint16 unicode) delete_selection(); if(text_.insert_unicode(selection_start_, unicode)) { - - // Update status set_cursor(selection_start_ + 1, false); - update_canvas(); - set_is_dirty(true); } + + // Since delete selection might have modified the content force an update. + update_canvas(); + set_is_dirty(true); } void ttext_::copy_selection(const bool mouse)