From: Ian Jackson Date: Mon, 11 Jan 2021 01:07:10 +0000 (+0000) Subject: otterlib: wip preview X-Git-Tag: otter-0.3.0~84 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6b34d11be53ba51cb42651fd393a6353a42efce8;p=otter.git otterlib: wip preview Signed-off-by: Ian Jackson --- 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(); -*/ -