aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/macgui/mactext.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index d7c3795070..9db5d459d7 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -448,6 +448,10 @@ void MacText::removeLastLine() {
}
void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) {
+ if (y > _textMaxHeight) {
+ x = _surface->w;
+ }
+
y = CLIP(y, 0, _textMaxHeight);
// FIXME: We should use bsearch() here
@@ -456,9 +460,6 @@ void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) {
while (*row && _textLines[*row].y > y)
(*row)--;
- if (y > _textMaxHeight)
- x = _surface->w;
-
*sy = _textLines[*row].y;
*col = 0;