Fixes to scrollbar mouse tracking

Click inside the scroll panel area would sometimes scroll even if you weren't clicking the scrollbar
This commit is contained in:
jacob1 2024-11-23 17:26:41 -05:00
parent 57593fb212
commit 653d43699e
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995

View File

@ -156,14 +156,13 @@ void ScrollPanel::XOnMouseMoved(int x, int y)
}
}
if (x > (Size.X-scrollBarWidth) && x < (Size.X-scrollBarWidth)+scrollBarWidth)
if (x > (Size.X-scrollBarWidth) && x < Size.X)
{
if (y > scrollPos && y < scrollPos+scrollHeight)
isMouseInsideScrollbar = true;
isMouseInsideScrollbar = y > scrollPos && y < scrollPos+scrollHeight;
isMouseInsideScrollbarArea = true;
}
else
isMouseInsideScrollbar = false;
isMouseInsideScrollbar = isMouseInsideScrollbarArea = false;
if (oldViewportPositionY != ViewportPosition.Y)
{