summaryrefslogtreecommitdiff
path: root/src/interface/Textbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/Textbox.cpp')
-rw-r--r--src/interface/Textbox.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp
index 0341ff3..bef3465 100644
--- a/src/interface/Textbox.cpp
+++ b/src/interface/Textbox.cpp
@@ -71,18 +71,8 @@ void Textbox::TextPosition()
void Textbox::SetText(std::string text)
{
cursor = text.length();
- if(masked)
- {
- char tempText[text.length()];
- memset(tempText, 0x8d, text.length());
- tempText[text.length()] = 0;
- displayText = tempText;
- }
- else
- {
- displayText = text;
- }
this->text = text;
+ this->displayText = text;
TextPosition();
}
@@ -168,7 +158,17 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
}
if(changed)
{
- SetText(text);
+ if(masked)
+ {
+ char tempText[text.length()];
+ memset(tempText, 0x8d, text.length());
+ tempText[text.length()] = 0;
+ displayText = tempText;
+ }
+ else
+ {
+ displayText = text;
+ }
if(actionCallback)
actionCallback->TextChangedCallback(this);
}