mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 11:51:52 +00:00
GRAPHICS: MACGUI: MacText: Fix selection condition
Outside the while loop we only check pos > 0 once.
This commit is contained in:
parent
1ef07ff5dd
commit
4c996feb5d
@ -1037,6 +1037,7 @@ void MacText::setSelection(int pos, bool start) {
|
||||
int row = 0, col = 0;
|
||||
int colX = 0;
|
||||
|
||||
if (pos > 0) {
|
||||
while (pos > 0) {
|
||||
if (pos < getLineCharWidth(row)) {
|
||||
for (uint i = 0; i < _textLines[row].chunks.size(); i++) {
|
||||
@ -1053,7 +1054,7 @@ void MacText::setSelection(int pos, bool start) {
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
pos -= getLineCharWidth(row) + (row ? 1 : 0);
|
||||
pos -= getLineCharWidth(row) + 1; // (row ? 1 : 0);
|
||||
}
|
||||
|
||||
row++;
|
||||
@ -1064,8 +1065,7 @@ void MacText::setSelection(int pos, bool start) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pos == -1) {
|
||||
} else {
|
||||
row = _textLines.size() - 1;
|
||||
colX = _surface->w;
|
||||
col = getLineCharWidth(row);
|
||||
|
Loading…
Reference in New Issue
Block a user