mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
SHERLOCK: RT: Further fixes for scrolling in Files dialog
This commit is contained in:
parent
05eb787ce5
commit
d8cdaabadf
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user