[Scummvm-cvs-logs] scummvm master -> 28af73777b2a1cf276b38624ac6a6009cffc1fd5
dreammaster
dreammaster at scummvm.org
Sun Aug 9 18:00:43 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
28af73777b SHERLOCK: RT: Fix crash when clicking in inventory at start of game
Commit: 28af73777b2a1cf276b38624ac6a6009cffc1fd5
https://github.com/scummvm/scummvm/commit/28af73777b2a1cf276b38624ac6a6009cffc1fd5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-09T11:59:52-04:00
Commit Message:
SHERLOCK: RT: Fix crash when clicking in inventory at start of game
Changed paths:
engines/sherlock/tattoo/widget_base.cpp
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 7a341cc..36202a1 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -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
More information about the Scummvm-git-logs
mailing list