mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed 1277 - only 2 cursor buttons will be enabled for sliders, depending on its direction (horizontal/vertical)
This commit is contained in:
parent
a17e27bfc6
commit
3939c70a81
@ -706,16 +706,24 @@ void CSlider::keyPressed(const SDL_KeyboardEvent & key)
|
||||
{
|
||||
if(key.state != SDL_PRESSED) return;
|
||||
|
||||
int moveDest = 0;
|
||||
int moveDest = value;
|
||||
switch(key.keysym.sym)
|
||||
{
|
||||
case SDLK_UP:
|
||||
if (!horizontal)
|
||||
moveDest = value - scrollStep;
|
||||
break;
|
||||
case SDLK_LEFT:
|
||||
moveDest = value - scrollStep;
|
||||
if (horizontal)
|
||||
moveDest = value - scrollStep;
|
||||
break;
|
||||
case SDLK_DOWN:
|
||||
if (!horizontal)
|
||||
moveDest = value + scrollStep;
|
||||
break;
|
||||
case SDLK_RIGHT:
|
||||
moveDest = value + scrollStep;
|
||||
if (horizontal)
|
||||
moveDest = value + scrollStep;
|
||||
break;
|
||||
case SDLK_PAGEUP:
|
||||
moveDest = value - capacity + scrollStep;
|
||||
|
Loading…
Reference in New Issue
Block a user