From 443212a62bfa69e5c15d2708f865116fc8719961 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Fri, 19 Mar 2021 19:34:52 +0100 Subject: [PATCH] Fix misc. output issues --- src/lib.rs | 4 +++- src/ui/svg.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e906501..3a37264 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -301,7 +301,9 @@ where I: IntoIterator } text += &print_implicate(x); } - text.push(')'); + if !text.is_empty() { + text.push(')'); + } text } diff --git a/src/ui/svg.rs b/src/ui/svg.rs index 9b2e854..2db13f4 100644 --- a/src/ui/svg.rs +++ b/src/ui/svg.rs @@ -114,7 +114,7 @@ pub fn get_svg(size_factor: usize, print_labels: bool, svg += &line_segment(-offset, y1 * size_factor, -offset, (y2 + 1) * size_factor) .width(2.0) .to_string(); - svg += &text(-offset - size8 as f32, (y1 + y2 + 1) * size_factor / 2, var_name) + svg += &text(-offset - size8 as f32, (y1 + y2 + 1) * size_factor / 2 + SIZE_FONT as usize / 2, var_name) .align(Align::Center) .size(SIZE_FONT) .to_string(); @@ -136,7 +136,7 @@ pub fn get_svg(size_factor: usize, print_labels: bool, svg += &line_segment(w_base + offset, y1 * size_factor, w_base + offset, (y2 + 1) * size_factor) .width(2.0) .to_string(); - svg += &text(w_base + offset + size8 as f32, (y1 + y2 + 1) * size_factor / 2, var_name) + svg += &text(w_base + offset + size8 as f32, (y1 + y2 + 1) * size_factor / 2 + SIZE_FONT as usize / 2, var_name) .align(Align::Center) .size(SIZE_FONT) .to_string();