From: david Date: Sat, 2 Mar 2002 19:40:26 +0000 (+0000) Subject: For property-scale, apply the squared option before factor, etc. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0296c04e320eee041c2d181ef6cbb74d09d7fed4;p=flightgear.git For property-scale, apply the squared option before factor, etc. --- diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 2f52e91de..36554cb23 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -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); }