1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

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

This commit is contained in:
jules 2017-10-09 16:31:30 +01:00
parent 38a4baa9dd
commit 1884e0142a

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)