From 4e9508e23a22a3103b78cc1e5245848dab276b0b Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 6 Aug 2017 23:40:41 +0200 Subject: [PATCH] TextAreaWidget: It feels natural now *.* --- SDK/include/NDK/Widgets/TextAreaWidget.inl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SDK/include/NDK/Widgets/TextAreaWidget.inl b/SDK/include/NDK/Widgets/TextAreaWidget.inl index f76147ec7..ffc75c8ba 100644 --- a/SDK/include/NDK/Widgets/TextAreaWidget.inl +++ b/SDK/include/NDK/Widgets/TextAreaWidget.inl @@ -121,7 +121,9 @@ namespace Ndk std::size_t lineCount = m_drawer.GetLineCount(); if (cursorPosition.y >= lineCount) cursorPosition.y = static_cast(lineCount - 1); - + + m_cursorPosition = cursorPosition; + const auto& lineInfo = m_drawer.GetLine(cursorPosition.y); if (cursorPosition.y + 1 < lineCount) { @@ -129,7 +131,13 @@ namespace Ndk cursorPosition.x = std::min(cursorPosition.x, static_cast(nextLineInfo.glyphIndex - lineInfo.glyphIndex - 1)); } - SetCursorPosition(lineInfo.glyphIndex + cursorPosition.x); //