From cc82c0edded3e73e840ec802b3c091a87f831a40 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 12 Jan 2021 00:49:44 +0000 Subject: [PATCH] otterlib: wip preview, reorg a bit nfc Signed-off-by: Ian Jackson --- src/bin/otterlib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index 98e48479..967cd2ce 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -54,16 +54,17 @@ fn preview(items: Vec) { println!(r#"{}"#, &spec.item); println!(r#"{}"#, pc.describe_html(None).0); let only1 = pc.nfaces() == 1; + let getpri = |face: FaceId| PieceRenderInstructions { + id: default(), + angle: VisiblePieceAngle(default()), + face + }; for face in 0..(if only1 { 1 } else { max_faces }) { print!(r#""#); if face < pc.nfaces() { - let pri = PieceRenderInstructions { - id: default(), - angle: VisiblePieceAngle(default()), - face: face.into(), - }; + let pri = getpri(face.into()); const BORDER: f64 = 1.; let bbox = pc .bbox_approx(); -- 2.30.2