]> git.mxchange.org Git - flightgear.git/commitdiff
For property-scale, apply the squared option before factor, etc.
authordavid <david>
Sat, 2 Mar 2002 19:40:26 +0000 (19:40 +0000)
committerdavid <david>
Sat, 2 Mar 2002 19:40:26 +0000 (19:40 +0000)
src/Main/fg_commands.cxx

index 2f52e91de381e68d7cd35b5faf039e8bb497155a..36554cb23830cd48ec1565a64e24006738415978 100644 (file)
@@ -543,9 +543,9 @@ do_property_scale (const SGPropertyNode * arg, SGCommandState ** state)
   bool squared =
     ((PropertyCommandState *)(*state))->getSquared()->getBoolValue();
 
-  double result = (setting + offset) * factor;
   if (squared)
-    result = (result < 0 ? -1 : 1) * result * result;
+    setting = (setting < 0 ? -1 : 1) * setting * setting;
+  double result = (setting + offset) * factor;
 
   return prop->setDoubleValue(result);
 }