From 6b34d11be53ba51cb42651fd393a6353a42efce8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 11 Jan 2021 01:07:10 +0000 Subject: [PATCH] otterlib: wip preview Signed-off-by: Ian Jackson --- src/bin/otterlib.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index 03cbcf83..beb55f53 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -56,6 +56,9 @@ fn preview(items: Vec) { angle: VisiblePieceAngle(default()), face: face.into(), }; + let bbox = pc.bbox_approx(); + let surround = pc.surround_path(&pri); + println!(r#"<--svg viewBox="{:?} {:?}""#, &bbox, &surround); let mut html = Html("".into()); pc.svg_piece(&mut html, &pri)?; println!("SVG\n{}\n\n", html.0); @@ -106,14 +109,3 @@ fn main() { } } } - -/* - let name = a.next().unwrap(); - let dirname = a.next().unwrap(); - let catalogue = format!("{}.toml", &dirname); - let e = shapelib::Explicit1 { - name, dirname, catalogue - }; - shapelib::load1(&e).unwrap(); -*/ - -- 2.30.2