Merge pull request #1591 from Azaezel/alpha41/thumbsSideways

scroll thumb safety
This commit is contained in:
Areloch 2025-11-21 21:55:57 -06:00 committed by GitHub
commit 91e354fe99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -800,7 +800,7 @@ void GuiScrollCtrl::onMouseDragged(const GuiEvent &event)
{
S32 newVPos = (newVThumbPos - mVTrackRect.point.y) *
(mChildExt.y - mContentExt.y) /
(mVTrackRect.extent.y - mVThumbSize);
getMax(mVTrackRect.extent.y - mVThumbSize,1);
scrollTo(mChildRelPosAnchor.x, newVPos);
}
@ -820,7 +820,7 @@ void GuiScrollCtrl::onMouseDragged(const GuiEvent &event)
{
S32 newHPos = (newHThumbPos - mHTrackRect.point.x) *
(mChildExt.x - mContentExt.x) /
(mHTrackRect.extent.x - mHThumbSize);
getMax(mHTrackRect.extent.x - mHThumbSize,1);
scrollTo(newHPos, mChildRelPosAnchor.y);
}