From bcb484e9411b6d22c37d5b260a1f76c5e5cc03b2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 16 Apr 2016 01:13:06 +0000 Subject: [PATCH] Do not display trailing zeroes for integer angles. Angles that aren't an integral number of degrees are extremely rare, and the label is often in a tight space, which warrants special-casing this. --- src/drawconstraint.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/drawconstraint.cpp b/src/drawconstraint.cpp index 2891a03..d8539b8 100644 --- a/src/drawconstraint.cpp +++ b/src/drawconstraint.cpp @@ -52,7 +52,11 @@ double Constraint::EllipticalInterpolation(double rx, double ry, double theta) { std::string Constraint::Label(void) { std::string result; if(type == ANGLE) { - result = ssprintf("%.2f°", valA); + if(valA == floor(valA)) { + result = ssprintf("%.0f°", valA); + } else { + result = ssprintf("%.2f°", valA); + } } else if(type == LENGTH_RATIO) { result = ssprintf("%.3f:1", valA); } else if(type == COMMENT) {