From 35c6af49293f7863ea6a0aa8855762b13af96fa7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 23 Jun 2020 01:16:58 +0000 Subject: [PATCH] Show center of mass using the same format as for constraints. --- src/draw.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/draw.cpp b/src/draw.cpp index 5c6dd8a7..c3ce4561 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -769,9 +769,13 @@ void GraphicsWindow::Draw(Canvas *canvas) { const double size = 10.0; const int subdiv = 16; double h = Style::DefaultTextHeight() / camera.scale; - canvas->DrawVectorText(ssprintf("%.3f, %.3f, %.3f", p.x, p.y, p.z), h, + std::string s = + SS.MmToStringSI(p.x) + ", " + + SS.MmToStringSI(p.y) + ", " + + SS.MmToStringSI(p.z); + canvas->DrawVectorText(s.c_str(), h, p.Plus(u.ScaledBy((size + 5.0)/scale)).Minus(v.ScaledBy(h / 2.0)), - u, v,hcsDatum); + u, v, hcsDatum); u = u.WithMagnitude(size / scale); v = v.WithMagnitude(size / scale);