From c02c36ce88f6de4cb3442898deb4f051364fb52e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Feb 2016 10:54:55 +0100 Subject: [PATCH] WAGE: Implemented a way to remove selection --- engines/wage/gui.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index ef0560777067..4e52801c7695 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -656,7 +656,6 @@ void Gui::processMenuShortCut(byte flags, uint16 ascii) { _menu->processMenuShortCut(flags, ascii); } - void Gui::mouseMove(int x, int y) { if (_menu->_menuActivated) { if (_menu->mouseMove(x, y)) @@ -701,9 +700,16 @@ Designed *Gui::mouseUp(int x, int y) { return NULL; } - if (_inTextSelection) + if (_inTextSelection) { _inTextSelection = false; + if (_selectionEndY == -1 || + (_selectionEndX == _selectionStartX && _selectionEndY == _selectionStartY)) { + _selectionStartY = _selectionEndY = -1; + _consoleFullRedraw = true; + } + } + if (_sceneArea.contains(x, y)) { if (!_sceneIsActive) { _sceneIsActive = true; @@ -774,6 +780,8 @@ void Gui::startMarking(int x, int y) { _selectionStartY = calcTextY(y); _selectionStartX = calcTextX(x, _selectionStartY); + _selectionEndY = -1; + _inTextSelection = true; }