Commit 209fdcbc authored by Jan Möbius's avatar Jan Möbius

Only react on wheel event if we are in the correct picking mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7505 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 144d7084
......@@ -275,11 +275,19 @@ void MovePlugin::initializePlugin()
*/
void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & /*_mode*/)
{
manip_size_modifier_ = manip_size_modifier_ - (float)_event->delta() / 120.0 * 0.1;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it->manipulatorNode()->set_size(manip_size_ * manip_size_modifier_);
emit visibilityChanged (-1);
// Skip execution if this is not our pick mode
if((PluginFunctions::pickMode() != "Move" && PluginFunctions::pickMode() != "MoveSelection") || PluginFunctions::actionMode() != Viewer::PickingMode)
return;
// compute the manipulator size modifier based on the mouse wheel change
manip_size_modifier_ = manip_size_modifier_ - (float)_event->delta() / 120.0 * 0.1;
// Resize all manipulators based on the modifier on all objects
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it->manipulatorNode()->set_size(manip_size_ * manip_size_modifier_);
// Redraw scene with updated manipulators
emit updateView();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment