parent
1ba1e7e59f
commit
bd245e17bf
@ -146,7 +146,7 @@ bool CGUIScrollBar::OnEvent(const SEvent& event)
|
||||
// thanks to tommi by tommi for another bugfix
|
||||
// everybody needs a little thanking. hallo niko!;-)
|
||||
setPos( getPos() +
|
||||
( (event.MouseInput.Wheel < 0 ? -1 : 1) * SmallStep * (Horizontal ? 1 : -1 ) )
|
||||
( event.MouseInput.Wheel * SmallStep * (Horizontal ? 1 : -1 ) )
|
||||
);
|
||||
|
||||
SEvent newEvent;
|
||||
|
@ -833,14 +833,20 @@ bool CIrrDeviceSDL::run()
|
||||
break;
|
||||
|
||||
case SDL_MOUSEWHEEL:
|
||||
if (SDL_event.wheel.x > 0 || SDL_event.wheel.x < 0)
|
||||
break;
|
||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
|
||||
irrevent.MouseInput.X = MouseX;
|
||||
irrevent.MouseInput.Y = MouseY;
|
||||
|
||||
irrevent.MouseInput.ButtonStates = MouseButtonStates;
|
||||
irrevent.MouseInput.Wheel = SDL_event.wheel.y > 0 ? 1.0f : -1.0f;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 18)
|
||||
irrevent.MouseInput.Wheel =
|
||||
SDL_event.wheel.preciseX + SDL_event.wheel.preciseY;
|
||||
#else
|
||||
irrevent.MouseInput.Wheel = irr::core::clamp<irr::f32>(
|
||||
SDL_event.wheel.x + SDL_event.wheel.y, -1.0f, 1.0f);
|
||||
#endif
|
||||
|
||||
postEventFromUser(irrevent);
|
||||
break;
|
||||
|
||||
|
@ -363,7 +363,7 @@ bool CGUISTKListBox::OnEvent(const SEvent& event)
|
||||
switch(event.MouseInput.Event)
|
||||
{
|
||||
case EMIE_MOUSE_WHEEL:
|
||||
ScrollBar->setPos(ScrollBar->getPos() + (event.MouseInput.Wheel < 0 ? -1 : 1)*-ItemHeight/2);
|
||||
ScrollBar->setPos(ScrollBar->getPos() + event.MouseInput.Wheel * -ItemHeight / 2);
|
||||
return true;
|
||||
|
||||
case EMIE_LMOUSE_PRESSED_DOWN:
|
||||
|
Loading…
x
Reference in New Issue
Block a user