From c870caee03f86faea23a561a121222701e4dac5f Mon Sep 17 00:00:00 2001 From: Alec Lofquist Date: Sat, 18 Oct 2014 15:46:14 -0500 Subject: [PATCH] Fix newlines messing up cursor offset. Fix an uninitialized value in TextEditComponent. --- es-core/src/components/TextEditComponent.cpp | 3 ++- es-core/src/resources/Font.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/TextEditComponent.cpp b/es-core/src/components/TextEditComponent.cpp index aedb7cff8..af5799192 100644 --- a/es-core/src/components/TextEditComponent.cpp +++ b/es-core/src/components/TextEditComponent.cpp @@ -13,7 +13,8 @@ TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window), mBox(window, ":/textinput_ninepatch.png"), mFocused(false), - mScrollOffset(0.0f, 0.0f), mCursor(0), mEditing(false), mFont(Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)) + mScrollOffset(0.0f, 0.0f), mCursor(0), mEditing(false), mFont(Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)), + mCursorRepeatDir(0) { addChild(&mBox); diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index f8cd9dc6a..7e02249b1 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -684,7 +684,6 @@ Eigen::Vector2f Font::getWrappedTextCursorOffset(std::string text, float xLen, s { lineWidth = 0.0f; y += getHeight(lineSpacing); - wrapCursor = getPrevCursor(wrappedText, wrapCursor); // unconsume continue; }