From 75748c9632b88ef5fcdbf9fa736db828fb07a1af Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 13 Feb 2021 01:22:01 +0000 Subject: [PATCH] SimpleShape: svg_piece: Introduce f local NFC Signed-off-by: Ian Jackson --- src/pieces.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pieces.rs b/src/pieces.rs index a749ee09..7012cbc8 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -122,6 +122,7 @@ impl Outline for SimpleShape { impl Piece for SimpleShape { #[throws(IE)] fn svg_piece(&self, f: &mut Html, pri: &PieceRenderInstructions) { + let f = &mut f.0; let ef = |cmap: &ColourMap, attrname: &str, otherwise: &str| { if let Some(colour) = cmap.get(pri.face) { format!(r##"{}="{}""##, attrname, colour.0) @@ -130,12 +131,12 @@ impl Piece for SimpleShape { } }; if self.colours.len() == 0 { - write!(&mut f.0, + write!(f, r##""##, &self.path.0)?; } - write!(&mut f.0, r##""##, + write!(f, r##""##, ef(&self.colours, "fill", r##"fill="none""##), ef(&self.edges, r##"stroke-width="0.2" stroke"##, ""), &self.path.0)?; -- 2.30.2