]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGExpression.hxx
SGPath rename wrapper. Let's see what Win32 makes of it.
[simgear.git] / simgear / structure / SGExpression.hxx
index 1f599b760ab50528beb8a58851c42a55657a09a8..420a9045ce001926310942e49e4ffbdaa21b2327 100644 (file)
@@ -665,12 +665,14 @@ public:
 private:
   T apply_mods(T property) const
   {
+    if( _step <= SGLimits<T>::min() ) return property;
+
     // apply stepping of input value
     T modprop = floor(property/_step)*_step;
 
     // calculate scroll amount (for odometer like movement)
-    T remainder = property < 0 ? -fmod(property,_step) : (_step - fmod(property,_step));
-    if( remainder > 0.0 && remainder < _scroll )
+    T remainder = property <= SGLimits<T>::min() ? -fmod(property,_step) : (_step - fmod(property,_step));
+    if( remainder > SGLimits<T>::min() && remainder < _scroll )
       modprop += (_scroll - remainder) / _scroll * _step;
 
     return modprop;
@@ -1246,7 +1248,7 @@ namespace simgear
     ConvertExpression() {}
     ConvertExpression(::SGExpression<OpType>* expr0)
     {
-      addOperand(expr0);
+      this->addOperand(expr0);
     }
     virtual void eval(T& value, const simgear::expression::Binding* b) const
     {