From 75491291f9c8cb737dba273cd2ff2abe1ee74bb2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 5 Aug 2017 08:12:43 +0200 Subject: GRAPHICS: MACGUI: Made CLIP statemements more useful --- graphics/macgui/mactext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/macgui') diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 23442d05f4..551dead1c5 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -446,7 +446,7 @@ void MacText::removeLastLine() { } void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) { - CLIP(y, 0, _textMaxHeight); + y = CLIP(y, 0, _textMaxHeight); // FIXME: We should use bsearch() here *row = _textLines.size() - 1; @@ -498,8 +498,8 @@ void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) { Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int endCol, bool formatted) { Common::String res; - CLIP(startRow, 0, (int)_textLines.size() - 1); - CLIP(endRow, 0, (int)_textLines.size() - 1); + startRow = CLIP(startRow, 0, (int)_textLines.size() - 1); + endRow = CLIP(endRow, 0, (int)_textLines.size() - 1); for (int i = startRow; i <= endRow; i++) { if (i == startRow && i == endRow) { -- cgit v1.2.3