From db0a8c2da858cfd86f7206ce48d09bbf3ffd3aad Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Wed, 30 Oct 2024 23:57:15 -0700 Subject: [PATCH] Round element vectors to three decimal places --- app-proto/main.css | 2 +- app-proto/src/outline.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app-proto/main.css b/app-proto/main.css index 030f56a..ba8a20b 100644 --- a/app-proto/main.css +++ b/app-proto/main.css @@ -102,7 +102,7 @@ details[open]:has(li) .elt-switch::after { .elt-rep > div { padding: 2px 0px 0px 0px; font-size: 10pt; - text-align: center; + text-align: right; width: 56px; } diff --git a/app-proto/src/outline.rs b/app-proto/src/outline.rs index f12e7ae..aff3673 100644 --- a/app-proto/src/outline.rs +++ b/app-proto/src/outline.rs @@ -73,7 +73,7 @@ fn ElementOutlineItem(key: ElementKey, element: assembly::Element) -> View { }); let label = element.label.clone(); let rep_components = element.representation.iter().map(|u| { - let u_coord = u.to_string().replace("-", "\u{2212}"); + let u_coord = format!("{:.3}", u).replace("-", "\u{2212}"); View::from(div().children(u_coord)) }).collect::>(); let constrained = element.constraints.len() > 0;