diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2015-12-28 21:54:50 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2016-01-27 17:53:13 +0100 |
commit | fbb4353a247157d32208f8f133cd1ee42f4fbc49 (patch) | |
tree | 6f819fbdd21f2adef4f7ba4a5b4d02054cc02f29 /gui/input.cpp | |
parent | Adopted Storage support (diff) | |
download | android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar.gz android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar.bz2 android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar.lz android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar.xz android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.tar.zst android_bootable_recovery-fbb4353a247157d32208f8f133cd1ee42f4fbc49.zip |
Diffstat (limited to '')
-rw-r--r-- | gui/input.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gui/input.cpp b/gui/input.cpp index 68bd163b9..c12ecc2b2 100644 --- a/gui/input.cpp +++ b/gui/input.cpp @@ -39,8 +39,8 @@ extern "C" { #include "../twcommon.h" -#include "../minuitwrp/minui.h" } +#include "../minuitwrp/minui.h" #include "rapidxml.hpp" #include "objects.hpp" @@ -196,7 +196,7 @@ int GUIInput::HandleTextLocation(int x) maskedValue += mMask; displayValue = maskedValue; } - textWidth = gr_measureEx(displayValue.c_str(), fontResource); + textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); if (textWidth <= mRenderW) { lastX = x; scrollingX = 0; @@ -209,7 +209,7 @@ int GUIInput::HandleTextLocation(int x) if (skipChars && skipChars < displayValue.size()) displayValue.erase(0, skipChars); - textWidth = gr_measureEx(displayValue.c_str(), fontResource); + textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); mRendered = false; int deltaX, deltaText, newWidth; @@ -222,11 +222,11 @@ int GUIInput::HandleTextLocation(int x) if (mCursorLocation == -1) { displayValue = originalValue; skipChars = 0; - textWidth = gr_measureEx(displayValue.c_str(), fontResource); + textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); while (textWidth > mRenderW) { displayValue.erase(0, 1); skipChars++; - textWidth = gr_measureEx(displayValue.c_str(), fontResource); + textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); } scrollingX = mRenderW - textWidth; mInputText->SkipCharCount(skipChars); @@ -237,12 +237,12 @@ int GUIInput::HandleTextLocation(int x) cursorLocate = displayValue; cursorLocate.resize(mCursorLocation); - textWidth = gr_measureEx(cursorLocate.c_str(), fontResource); + textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource); while (textWidth > mRenderW) { skipChars++; mCursorLocation--; cursorLocate.erase(0, 1); - textWidth = gr_measureEx(cursorLocate.c_str(), fontResource); + textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource); adjust_scrollingX = -1; } if (adjust_scrollingX) { @@ -261,7 +261,7 @@ int GUIInput::HandleTextLocation(int x) } insertChar = originalValue.substr(skipChars - 1, 1); displayValue.insert(0, insertChar); - newWidth = gr_measureEx(displayValue.c_str(), fontResource); + newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); deltaText = newWidth - textWidth; if (newWidth > mRenderW) { scrollingX = mRenderW - textWidth; @@ -289,7 +289,7 @@ int GUIInput::HandleTextLocation(int x) } insertChar = originalValue.substr(skipChars - 1, 1); displayValue.insert(0, insertChar); - newWidth = gr_measureEx(displayValue.c_str(), fontResource); + newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); deltaText = newWidth - textWidth; if (deltaText < deltaX) { lastX += deltaText; @@ -324,7 +324,7 @@ int GUIInput::HandleTextLocation(int x) deltaX = lastX - x; displayValue.erase(0, 1); skipChars++; - newWidth = gr_measureEx(displayValue.c_str(), fontResource); + newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource); deltaText = textWidth - newWidth; if (newWidth <= mRenderW) { scrollingX = mRenderW - newWidth; @@ -407,15 +407,15 @@ int GUIInput::Render(void) cursorDisplay = displayValue; cursorDisplay.resize(mCursorLocation); - cursorX = gr_measureEx(cursorDisplay.c_str(), fontResource) + mRenderX; + cursorX = gr_ttf_measureEx(cursorDisplay.c_str(), fontResource) + mRenderX; } else { // Cursor location is after the end of the text - reset to -1 mCursorLocation = -1; - cursorX = gr_measureEx(displayValue.c_str(), fontResource) + mRenderX; + cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX; } } else { // Cursor is at the end (-1) - cursorX = gr_measureEx(displayValue.c_str(), fontResource) + mRenderX; + cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX; } } cursorX += scrollingX; @@ -534,7 +534,7 @@ int GUIInput::NotifyTouch(TOUCH_STATE state, int x, int y) for(index=0; index<displayValue.size(); index++) { cursorString = displayValue.substr(0, index); - cursorX = gr_measureEx(cursorString.c_str(), fontResource) + mRenderX; + cursorX = gr_ttf_measureEx(cursorString.c_str(), fontResource) + mRenderX; if (cursorX > x) { if (index > 0) mCursorLocation = index - 1; |