From 14138d9f74c7b56e600166a993ea62818fa0f840 Mon Sep 17 00:00:00 2001 From: Sultan Qasim Khan Date: Mon, 4 Apr 2016 04:11:25 -0400 Subject: gui: don't mix up display value with actual value In the case of password entry, the two differ. Password entry was broken by the earlier commit entitled "Improve input box text handling" because it started using the displayValue as the actual value, even in cases where they differ because of a mask value. Change-Id: Iaf5a67e1d928f34595962a1f1b80eebb64e8b493 --- gui/objects.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gui/objects.hpp') diff --git a/gui/objects.hpp b/gui/objects.hpp index 7913b36cb..84a9e5ecf 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -1000,7 +1000,7 @@ protected: // Handles displaying the text properly when chars are added, deleted, or for scrolling void HandleTextLocation(int x); - void UpdateTextWidth(); + void UpdateDisplayText(); void HandleCursorByTouch(int x); void HandleCursorByText(); @@ -1010,15 +1010,14 @@ protected: ImageResource* mBackground; ImageResource* mCursor; FontResource* mFont; - std::string mText; - std::string mLastValue; std::string mVariable; std::string mMask; + std::string mValue; std::string displayValue; COLOR mBackgroundColor; COLOR mCursorColor; int scrollingX; - int cursorX; + int cursorX; // actual x axis location of the cursor int lastX; int mCursorLocation; int mBackgroundX, mBackgroundY, mBackgroundW, mBackgroundH; -- cgit v1.2.3