From 1884e0142adb8c7af7a43257c507258cce4ed5db Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 9 Oct 2017 16:31:30 +0100 Subject: [PATCH] Corrected a small bug in TextEditor when clicking to the right of the last line to place the cursor. --- modules/juce_gui_basics/widgets/juce_TextEditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index e07685f871..0f3fd82af3 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -2400,12 +2400,12 @@ int TextEditor::indexAtPosition (const float x, const float y) { for (Iterator i (*this); i.next();) { - if (i.lineY + i.lineHeight > y) + if (y < i.lineY + i.lineHeight) { - if (i.lineY > y) + if (y < i.lineY) return jmax (0, i.indexInText - 1); - if (i.atomX >= x) + if (x <= i.atomX || i.atom->isNewLine()) return i.indexInText; if (x < i.atomRight)