diff options
| -rw-r--r-- | engines/sherlock/tattoo/widget_base.cpp | 17 | ||||
| -rw-r--r-- | engines/sherlock/tattoo/widget_files.cpp | 2 | 
2 files changed, 3 insertions, 16 deletions
| diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp index e0b903916b..cc8e5c94c0 100644 --- a/engines/sherlock/tattoo/widget_base.cpp +++ b/engines/sherlock/tattoo/widget_base.cpp @@ -330,21 +330,8 @@ void WidgetBase::handleScrolling(int &scrollIndex, int pageSize, int max) {  			yp = CLIP(yp, r.top + BUTTON_SIZE + 3, r.bottom - BUTTON_SIZE - 3);  			// Calculate the line number that corresponds to the position that the mouse is on the scrollbar -			int lineNum = (yp - _bounds.top - BUTTON_SIZE - 3) * 100 / (_bounds.height() - BUTTON_SIZE * 2 - 6) -				* max / 100 - 3; - -			// If the new position would place part of the text outsidethe text window, adjust it so it doesn't -			if (lineNum < 0) -				lineNum = 0; -			else if (lineNum + pageSize > max) { -				lineNum = max - pageSize; - -				// Make sure it's not below zero now -				if (lineNum < 0) -					lineNum = 0; -			} - -			scrollIndex = lineNum; +			int lineNum = (yp - r.top - BUTTON_SIZE - 3) * (max - pageSize) / (r.height() - BUTTON_SIZE * 2 - 6); +			scrollIndex = CLIP(lineNum, 0, max - pageSize);  		}  		// Get the current frame so we can check the scroll timer against it diff --git a/engines/sherlock/tattoo/widget_files.cpp b/engines/sherlock/tattoo/widget_files.cpp index 4a0c0495e0..29ca0c56fe 100644 --- a/engines/sherlock/tattoo/widget_files.cpp +++ b/engines/sherlock/tattoo/widget_files.cpp @@ -150,7 +150,7 @@ void WidgetFiles::render(FilesRenderMode mode) {  				color = INFO_TOP;  			if (mode == RENDER_NAMES_AND_SCROLLBAR) -				_surface.fillRect(Common::Rect(4, yp, _surface.w() - BUTTON_SIZE - 9, yp + _surface.fontHeight() - 1), TRANSPARENCY); +				_surface.fillRect(Common::Rect(4, yp, _surface.w() - BUTTON_SIZE - 9, yp + _surface.fontHeight()), TRANSPARENCY);  			Common::String numStr = Common::String::format("%d.", idx + 1);  			_surface.writeString(numStr, Common::Point(_surface.widestChar(), yp), color); | 
