From: Ian Jackson Date: Sun, 12 Jul 2020 17:19:10 +0000 (+0100) Subject: wip before more outline change X-Git-Tag: otter-0.2.0~1345 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bcd7e9a7936aa69ffbc6ae52f1fb0610206dfea1;p=otter.git wip before more outline change --- diff --git a/src/gamestate.rs b/src/gamestate.rs index 69f5e631..3be5c771 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -71,8 +71,10 @@ pub trait Piece : Send + Debug { // #[throws] doesn't work here for some reason fn svg_piece(&self, f: &mut String, pri: &PieceRenderInstructions) -> SR; +/* #[throws(SE)] fn outline_path(&self, pri : &PieceRenderInstructions) -> String; +*/ #[throws(SE)] fn surround_path(&self, pri : &PieceRenderInstructions) -> String; @@ -149,10 +151,9 @@ impl PieceState { r##""##, pri.id, pr.p.surround_path(&pri)?)?; write!(defs, - r##""##, + r##""##, pri.id, - pr.p.surround_path(&pri)?, - pr.p.outline_path(&pri)?)?; + pr.p.surround_path(&pri)?)?; pr.p.svg_x_defs(&mut defs, &pri)?; defs } diff --git a/src/pieces.rs b/src/pieces.rs index c679e8a6..63a987f7 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -86,12 +86,16 @@ impl Piece for SimpleShape { #[throws(SE)] fn svg_piece(&self, f: &mut String, pri: &PieceRenderInstructions) { write!(f, r##""##, - self.colours[pri.face], self.path)?; + self.colours[pri.face], + svg_rescale_path(&self.path, 0.5)?, + )?; } +/* #[throws(SE)] fn outline_path(&self, _pri : &PieceRenderInstructions) -> String { self.path.clone() } +*/ #[throws(SE)] fn surround_path(&self, _pri : &PieceRenderInstructions) -> String { self.scaled_path.clone()