[Scummvm-cvs-logs] scummvm master -> 238ec804cf075e36581f42430a13527febbd97b5
dreammaster
dreammaster at scummvm.org
Sat Aug 1 00:39:34 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:
238ec804cf SHERLOCK: RT: Fix crash when scrollbar count equals page size
Commit: 238ec804cf075e36581f42430a13527febbd97b5
https://github.com/scummvm/scummvm/commit/238ec804cf075e36581f42430a13527febbd97b5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-31T18:38:32-04:00
Commit Message:
SHERLOCK: RT: Fix crash when scrollbar count equals page size
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 539d4a2..856d745 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -269,7 +269,8 @@ void WidgetBase::drawScrollBar(int index, int pageSize, int count) {
// Draw 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);
_surface.fillRect(Common::Rect(r.left + 2, barY + 2, r.right - 2, barY + barHeight - 3), INFO_MIDDLE);
ui.drawDialogRect(_surface, Common::Rect(r.left, barY, r.right, barY + barHeight), true);
More information about the Scummvm-git-logs
mailing list