Skip to content

Commit

Permalink
WAGE: Fix crash and remove debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 14, 2016
1 parent 30713e4 commit 8ee5d6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions engines/wage/gui.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8ee5d6e

Please sign in to comment.