From b29026349b5ce0cca00e37403bf5f4a027955ae6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 12 Jan 2021 18:30:47 +0000 Subject: [PATCH] otterlib: wip preview, show surround Signed-off-by: Ian Jackson --- src/bin/otterlib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index e3b3da1b..98c757b9 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -127,13 +127,19 @@ fn preview(items: Vec) { .join(" "); let wh = size.iter().map(|&s| s * SVG_SCALE) .collect::>(); - let surround = pc.surround_path(&pri); + let surround = pc.surround_path(&pri)?; print!(r#""#, &viewport, wh[0], wh[1]); + if inseveral == 1 { + let dasharray = player_dasharray(1.try_into().unwrap()); + print!(r#""#, + &surround.0, &dasharray, HELD_SURROUND_COLOUR); + } let mut html = Html("".into()); pc.svg_piece(&mut html, &pri)?; - println!("{}", html.0); + println!("{}", html.0); // // println!(r#" width={} height={} {:?}"#, // &viewport, size[0], size[1], &surround); -- 2.30.2