Avoid negative precision to produce good strings always and add U+00B0 DEGREE SIGN
authorCarlos Lopez <genetita@gmail.com>
Thu, 16 Dec 2010 20:58:07 +0000 (21:58 +0100)
committerCarlos Lopez <genetita@gmail.com>
Thu, 16 Dec 2010 20:58:07 +0000 (21:58 +0100)
synfig-core/src/synfig/valuenode_anglestring.cpp

index 99b51ef..b64a42f 100644 (file)
@@ -95,13 +95,14 @@ ValueNode_AngleString::operator()(Time t)const
        int precision((*precision_)(t).get(int()));
        int zero_pad((*zero_pad_)(t).get(bool()));
 
+       if(precision<0) precision=0;
        switch (get_type())
        {
        case ValueBase::TYPE_STRING:
                return strprintf(strprintf("%%%s%d.%df",
                                                                   zero_pad ? "0" : "",
                                                                   width,
-                                                                  precision).c_str(), angle);
+                                                                  precision).c_str(), angle)+"°";
        default:
                break;
        }