1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

* improved slider

* fixed leaving battles
This commit is contained in:
Michał W. Urbańczyk
2008-04-15 17:12:21 +00:00
parent 54f94cf5ef
commit e8056d0d80
2 changed files with 37 additions and 5 deletions

View File

@@ -476,7 +476,14 @@ template<typename T>
void CSlider<T>::clickLeft (tribool down)
{
if(down)
{
float pw = LOCPLINT->current->motion.x-pos.x-16;
float rw = pw / ((float)(pos.w-32));
if (rw>1) rw=1;
if (rw<0) rw=0;
moveTo(rw*amount);
return;
}
if(moving)
{
MotionInterested::deactivate();