Avoid negative precision to produce good strings always and add U+00B0 DEGREE SIGN
[synfig.git] / synfig-core / src / synfig / valuenode_anglestring.cpp
index 978b8b8..b64a42f 100644 (file)
@@ -65,8 +65,6 @@ ValueNode_AngleString::ValueNode_AngleString(const ValueBase &value):
        default:
                throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
        }
-
-       DCAST_HACK_ENABLE();
 }
 
 LinkableValueNode*
@@ -97,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;
        }