Skip to content

Commit

Permalink
LAB: Ignore clicks in empty region in monitor
Browse files Browse the repository at this point in the history
Regression from e71f28d
  • Loading branch information
wjp committed Jan 5, 2016
1 parent b72c02b commit 9cb7535
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions engines/lab/special.cpp
Expand Up @@ -387,11 +387,15 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
int16 mouseX = msg->_mouse.x;
int16 mouseY = msg->_mouse.y;

// Check if mouse was in button bar
if ((mouseY >= _utils->vgaScaleY(171)) && (mouseY <= _utils->vgaScaleY(200))) {
if (mouseX <= _utils->vgaScaleX(31))
if (mouseX <= _utils->vgaScaleX(31)) {
// Exit button
return;
}

if (mouseX <= _utils->vgaScaleX(59)) {
// Back button
if (isInteractive) {
_monitorPage = 0;

Expand All @@ -404,14 +408,15 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
drawMonText(ntext, monitorFont, textRect, isInteractive);
}
} else if (mouseX < _utils->vgaScaleX(259)) {
return;
// empty region; ignore
} else if (mouseX <= _utils->vgaScaleX(289)) {
// Page down button
if (!_lastPage) {
_monitorPage += 1;
drawMonText(ntext, monitorFont, textRect, isInteractive);
}
} else if (_monitorPage >= 1) {
// mouseX is greater than 290 (scaled)
// Page up button
_monitorPage -= 1;
drawMonText(ntext, monitorFont, textRect, isInteractive);
}
Expand Down

0 comments on commit 9cb7535

Please sign in to comment.