TextEditor bordersize issue


#1

Hi Jules

The bordersize is still not compensated for in TextEditor::getTextIndexAt() mentioned by Vinnie here a long time ago:

http://www.juce.com/forum/topic/texteditor-border-gooberlicious

I think the fix is simply:

 

int TextEditor::getTextIndexAt (const int x, const int y)
{
    return indexAtPosition ((float) (x + viewport->getViewPositionX() - leftIndent - borderSize.getLeft()),
                            (float) (y + viewport->getViewPositionY() - topIndent - borderSize.getTop()));
}

Cheers,

Martin


#2

Nice one, thanks Martin!