diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp
index 6da49ea28..348a33b8b 100644
--- a/src/Gui/ViewProviderGeometryObject.cpp
+++ b/src/Gui/ViewProviderGeometryObject.cpp
@@ -52,6 +52,7 @@
#include "Document.h"
#include "Window.h"
+#include
#include
#include
#include
@@ -62,6 +63,7 @@
#endif
#include "SoNavigationDragger.h"
#include "SoFCUnifiedSelection.h"
+#include
using namespace Gui;
@@ -190,6 +192,7 @@ void ViewProviderGeometryObject::updateData(const App::Property* prop)
pcTransform->rotation.setValue(q0,q1,q2,q3);
pcTransform->translation.setValue(px,py,pz);
pcTransform->center.setValue(0.0f,0.0f,0.0f);
+ pcTransform->scaleFactor.setValue(1.0f,1.0f,1.0f);
}
}
@@ -445,6 +448,12 @@ void ViewProviderGeometryObject::dragMotionCallback(void * data, SoDragger * d)
SbVec3f center = manip->center.getValue();
manip->rotation.getValue().getValue(q0, q1, q2, q3);
+ // it can happen that the values of the motion matrix is garbage
+ if (boost::math::isnan(q0)) {
+ Base::Console().Warning("NaN values received in ViewProviderGeometryObject::dragMotionCallback\n");
+ return;
+ }
+
// get the placement
ViewProviderGeometryObject* view = reinterpret_cast(data);
if (view && view->pcObject && view->pcObject->getTypeId().isDerivedFrom(App::GeoFeature::getClassTypeId())) {