diff options
author | Strangerke | 2015-12-15 16:18:32 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:05 +0100 |
commit | e71f28d0ba319bca35056b7e88d8ebfe0ea92017 (patch) | |
tree | cbac4366e4848336e83ead23e712d991dae9b301 /engines/lab/special.cpp | |
parent | 2cfac1c4b07c9cffc80afbb825eb7d517f8d2446 (diff) | |
download | scummvm-rg350-e71f28d0ba319bca35056b7e88d8ebfe0ea92017.tar.gz scummvm-rg350-e71f28d0ba319bca35056b7e88d8ebfe0ea92017.tar.bz2 scummvm-rg350-e71f28d0ba319bca35056b7e88d8ebfe0ea92017.zip |
LAB: Reorder mouse position check in processMonitor in order to avoid duplicate checks
Diffstat (limited to 'engines/lab/special.cpp')
-rw-r--r-- | engines/lab/special.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 3cad962c29..38921ea650 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -435,19 +435,9 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera return; else if ((msgClass == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & qualifier)) { if ((mouseY >= _utils->vgaScaleY(171)) && (mouseY <= _utils->vgaScaleY(200))) { - if ((mouseX >= _utils->vgaScaleX(259)) && (mouseX <= _utils->vgaScaleX(289))) { - if (!_lastPage) { - _monitorPage += 1; - drawMonText(ntext, monitorFont, x1, y1, x2, y2, isInteractive); - } - } else if ((mouseX >= _utils->vgaScaleX(0)) && (mouseX <= _utils->vgaScaleX(31))) { + if (mouseX <= _utils->vgaScaleX(31)) { return; - } else if ((mouseX >= _utils->vgaScaleX(290)) && (mouseX <= _utils->vgaScaleX(320))) { - if (_monitorPage >= 1) { - _monitorPage -= 1; - drawMonText(ntext, monitorFont, x1, y1, x2, y2, isInteractive); - } - } else if ((mouseX >= _utils->vgaScaleX(31)) && (mouseX <= _utils->vgaScaleX(59))) { + } else if (mouseX <= _utils->vgaScaleX(59)) { if (isInteractive) { _monitorPage = 0; @@ -459,6 +449,17 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera _monitorPage = 0; drawMonText(ntext, monitorFont, x1, y1, x2, y2, isInteractive); } + } else if (mouseX < _utils->vgaScaleX(259)) { + return; + } else if (mouseX <= _utils->vgaScaleX(289)) { + if (!_lastPage) { + _monitorPage += 1; + drawMonText(ntext, monitorFont, x1, y1, x2, y2, isInteractive); + } + } else if (_monitorPage >= 1) { + // mouseX between 290 and 320 (scaled) + _monitorPage -= 1; + drawMonText(ntext, monitorFont, x1, y1, x2, y2, isInteractive); } } else if (isInteractive) { CloseDataPtr tmpClosePtr = _closeDataPtr; |