WAGE: Implemented a way to remove selection

This commit is contained in:
Eugene Sandulenko 2016-02-05 10:54:55 +01:00
parent 06ba17395d
commit c02c36ce88

View File

@ -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;
}