mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
* fixed Zamolxis 12th issue (The scroll tab in Creature Split window (sometimes also in Castle Recruit) often remains hanged to our mouse position, following it even if we move the mouse away from the scroll bar, away from the split/recruit window)
This commit is contained in:
@@ -274,6 +274,8 @@ void CSlider::sliderClicked()
|
|||||||
|
|
||||||
void CSlider::mouseMoved (const SDL_MouseMotionEvent & sEvent)
|
void CSlider::mouseMoved (const SDL_MouseMotionEvent & sEvent)
|
||||||
{
|
{
|
||||||
|
if( std::abs(sEvent.y-(pos.y+pos.h/2)) > pos.h/2+40 || std::abs(sEvent.x-(pos.x+pos.w/2)) > pos.w/2 )
|
||||||
|
return;
|
||||||
float v = sEvent.x - pos.x - 24;
|
float v = sEvent.x - pos.x - 24;
|
||||||
v/= (pos.w - 48);
|
v/= (pos.w - 48);
|
||||||
v*=amount;
|
v*=amount;
|
||||||
|
Reference in New Issue
Block a user