Commit f39340e5 authored by Matthias Möller's avatar Matthias Möller

no crash, if the manipulator is sized too small

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18536 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 99952701
......@@ -152,10 +152,15 @@ public:
/// Get current direction of z-Axis in world coordinates
Vec3d directionZ() const;
/// set cylindersize (height + radius)
void set_size( double _size) { set_manipulator_height_ = _size;
set_manipulator_radius_ = _size/10.0;
setDirty (); }
/// set cylindersize (height + radius). _size parameter has to be greater than zero
void set_size( double _size) {
if (_size > 0.0)
{
set_manipulator_height_ = _size;
set_manipulator_radius_ = _size/10.0;
setDirty ();
}
}
/// get cylindersize
double size() const { return set_manipulator_height_; }
......
......@@ -349,6 +349,10 @@ void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & /
// compute the manipulator size modifier based on the mouse wheel change
manip_size_modifier_ = manip_size_modifier_ - (float)_event->delta() / 120.0 * 0.1;
//dont scroll into negative sizes
if (manip_size_modifier_ < 0.0)
manip_size_modifier_ = 0.0;
// Resize all manipulators based on the modifier on all objects
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
......
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