Skip to content

Commit

Permalink
SHERLOCK: RT: Fix crash when clicking in inventory at start of game
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 9, 2015
1 parent d5af7b7 commit 28af737
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/sherlock/tattoo/widget_base.cpp
Expand Up @@ -293,7 +293,8 @@ void WidgetBase::handleScrollbarEvents(int index, int pageSize, int count) {
// Calculate the Scroll Position bar
int barHeight = (r.height() - BUTTON_SIZE * 2) * pageSize / count;
barHeight = CLIP(barHeight, BUTTON_SIZE, r.height() - BUTTON_SIZE * 2);
int barY = r.top + BUTTON_SIZE + (r.height() - BUTTON_SIZE * 2 - barHeight) * index / (count - pageSize);
int barY = (count <= pageSize) ? r.top + BUTTON_SIZE : r.top + BUTTON_SIZE +
(r.height() - BUTTON_SIZE * 2 - barHeight) * index / (count - pageSize);

if (Common::Rect(r.left, r.top, r.right, r.top + BUTTON_SIZE).contains(mousePos))
// Mouse on scroll up button
Expand Down

0 comments on commit 28af737

Please sign in to comment.