1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

wheelScrolled event now accepts distance instead of bool

This commit is contained in:
Ivan Savenko
2023-05-27 17:27:49 +03:00
parent e2a85e25fa
commit dc8e9cd048
8 changed files with 37 additions and 25 deletions

View File

@@ -707,7 +707,7 @@ void CSlider::showAll(Canvas & to)
CIntObject::showAll(to);
}
void CSlider::wheelScrolled(bool down, bool in)
void CSlider::wheelScrolled(int distance, bool in)
{
if (scrollBounds)
{
@@ -719,7 +719,7 @@ void CSlider::wheelScrolled(bool down, bool in)
// vertical slider -> scrolling up move slider upwards
// horizontal slider -> scrolling up moves slider towards right
bool positive = (down != horizontal);
bool positive = ((distance < 0) != horizontal);
moveTo(value + 3 * (positive ? +scrollStep : -scrollStep));
}