Fix bug on macOS scrolling frames w/mouse wheel in the wrong direction

Sometimes macOS returns us a delta of 0.0, so we should not move through
frames in that case.
This commit is contained in:
David Capello 2016-11-23 14:08:34 -03:00
parent eacf28b65a
commit abc586a6d4

View File

@ -113,15 +113,18 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
}
break;
case WHEEL_FRAME:
{
Command* command = CommandsModule::instance()->getCommandByName
((dz < 0.0) ? CommandId::GotoNextFrame:
CommandId::GotoPreviousFrame);
if (command)
UIContext::instance()->executeCommand(command);
}
case WHEEL_FRAME: {
Command* command = nullptr;
if (dz < 0.0)
command = CommandsModule::instance()->getCommandByName(CommandId::GotoNextFrame);
else if (dz > 0.0)
command = CommandsModule::instance()->getCommandByName(CommandId::GotoPreviousFrame);
if (command)
UIContext::instance()->executeCommand(command);
break;
}
case WHEEL_ZOOM: {
render::Zoom zoom = editor->zoom();