GRAPHICS: MACGUI: Better selection row detection
This commit is contained in:
parent
55a241494e
commit
9e81f4de89
1 changed files with 4 additions and 6 deletions
|
@ -449,15 +449,13 @@ void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) {
|
|||
CLIP(y, 0, _textMaxHeight);
|
||||
|
||||
// FIXME: We should use bsearch() here
|
||||
*row = 0;
|
||||
*row = _textLines.size() - 1;
|
||||
|
||||
while (*row < _textLines.size() && _textLines[*row].y < y)
|
||||
(*row)++;
|
||||
|
||||
if (*row == _textLines.size()) {
|
||||
while (*row && _textLines[*row].y > y)
|
||||
(*row)--;
|
||||
|
||||
if (y > _textMaxHeight)
|
||||
x = getLineWidth(*row);
|
||||
}
|
||||
|
||||
*sy = _textLines[*row].y;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue