Browse Source

Corrected a small bug in TextEditor when clicking to the right of the last line to place the cursor.

tags/2021-05-28
jules 8 years ago
parent
commit
1884e0142a
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp

+ 3
- 3
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -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)


Loading…
Cancel
Save