From 8ee5d6e9d1cda74d4ad35ca4d19a4d36996f11c4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 4 Feb 2016 18:30:49 +0100 Subject: WAGE: Fix crash and remove debug output --- engines/wage/gui.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index fc606e0907..2dc2e69977 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -731,6 +731,10 @@ void Gui::mouseDown(int x, int y) { int Gui::calcTextX(int x, int textLine) { const Graphics::Font *font = getConsoleFont(); + + if (textLine >= _lines.size()) + return 0; + Common::String str = _lines[textLine]; x -= _consoleTextArea.left; @@ -759,21 +763,16 @@ int Gui::calcTextY(int y) { } void Gui::startMarking(int x, int y) { - warning("x: %d y: %d", x, y); _selectionStartY = calcTextY(y); _selectionStartX = calcTextX(x, _selectionStartY); _inTextSelection = true; - - warning("x: %d y: %d -> %d %d", x, y, _selectionStartX, _selectionStartY); } void Gui::updateTextSelection(int x, int y) { _selectionEndY = calcTextY(y); _selectionEndX = calcTextX(x, _selectionEndY); - warning("x: %d y: %d -> %d %d", x, y, _selectionEndX, _selectionEndY); - _consoleFullRedraw = true; } -- cgit v1.2.3