1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fix slider scroll via UI buttons

This commit is contained in:
Ivan Savenko 2023-07-07 01:23:17 +03:00
parent 85655d5534
commit 41755c9d87

View File

@ -138,6 +138,10 @@ void CSlider::clickLeft(tribool down, bool previousState)
rw = pw / (pos.h-48);
}
// click on area covered by buttons -> ignore, will be handled by left/right buttons
if (!vstd::iswithin(rw, 0, 1))
return;
slider->clickLeft(true, slider->isMouseLeftButtonPressed());
scrollTo((int)(rw * positions + 0.5));
return;