aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-16 12:11:16 -0400
committerPaul Gilbert2015-07-16 12:11:16 -0400
commitea133b6cf0e9ce9efe454553ef434a1106565e06 (patch)
tree3223fe5651b0da8ab175177f09b44b30a0fa0a36 /engines/sherlock
parentf4bd1b594851fe5ffd0bc74b593c5295c017e2bf (diff)
downloadscummvm-rg350-ea133b6cf0e9ce9efe454553ef434a1106565e06.tar.gz
scummvm-rg350-ea133b6cf0e9ce9efe454553ef434a1106565e06.tar.bz2
scummvm-rg350-ea133b6cf0e9ce9efe454553ef434a1106565e06.zip
SHERLOCK: RT: Fixes for highlighting lines in talk dialog
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/tattoo/widget_talk.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp
index 6e4ef19928..6426a21783 100644
--- a/engines/sherlock/tattoo/widget_talk.cpp
+++ b/engines/sherlock/tattoo/widget_talk.cpp
@@ -217,7 +217,7 @@ void WidgetTalk::handleEvents() {
if (Common::Rect(_bounds.left, _bounds.top + 5, _bounds.right - 3, _bounds.bottom - 5).contains(mousePos)) {
if (_scroll) {
// Disregard the scrollbar when setting the statement number
- if (Common::Rect(_bounds.right - BUTTON_SIZE - 6, _bounds.top + 3, _bounds.right - 3, _bounds.bottom - 3).contains(mousePos))
+ if (!Common::Rect(_bounds.right - BUTTON_SIZE, _bounds.top, _bounds.right, _bounds.bottom).contains(mousePos))
_selector = (mousePos.y - _bounds.top - 5) / (_surface.fontHeight() + 1) + _talkScrollIndex;
} else {
_selector = (mousePos.y - _bounds.top - 5) / (_surface.fontHeight() + 1);
@@ -225,7 +225,7 @@ void WidgetTalk::handleEvents() {
// Now translate the line number of the displayed line into the appropriate
// Statement number or set it to 255 to indicate no Statement selected
- if (_selector < (int)_statementLines.size())
+ if (_selector >= 0 && _selector < (int)_statementLines.size())
_selector = _statementLines[_selector]._num;
else
_selector = -1;