From: Ian Jackson Date: Thu, 11 Mar 2021 16:47:26 +0000 (+0000) Subject: hidden fixes: Transform occulted versions too X-Git-Tag: otter-0.4.0~164 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2452b8fd36a1d33949973f2d084884ad9011004d;p=otter.git hidden fixes: Transform occulted versions too Signed-off-by: Ian Jackson --- diff --git a/src/shapelib.rs b/src/shapelib.rs index daf1f020..11e22129 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -55,6 +55,7 @@ struct OccData { item_name: Arc, outline: Outline, desc: Html, + xform: FaceTransform, svg: parking_lot::Mutex>>, } @@ -152,6 +153,7 @@ struct Item { struct ItemOccultable { svg: Arc, desc: Html, + xform: FaceTransform, outline: Outline, } @@ -164,7 +166,9 @@ impl OutlineTrait for ItemOccultable { delegate! { to self.outline { #[typetag::serde(name="Lib")] impl OccultedPieceTrait for ItemOccultable { #[throws(IE)] - fn svg(&self, f: &mut Html, _:VisiblePieceId) { f.0.write_str(&self.svg.0)? } + fn svg(&self, f: &mut Html, _: VisiblePieceId) { + self.xform.write_svgd(f, &self.svg)?; + } #[throws(IE)] fn describe_html(&self) -> Html { self.desc.clone() } } @@ -298,6 +302,7 @@ impl Contents { }; let it = Box::new(ItemOccultable { svg, + xform: occ.xform.clone(), desc: occ.desc.clone(), outline: occ.outline.clone(), }) as Box; @@ -475,6 +480,7 @@ fn load_catalogue(libname: &str, dirname: &str, toml_path: &str) -> Contents { item_name: Arc::new(subst(&item_name, "_c", &colour)?), desc: Html(subst(&fe.desc.0, "_colour", "")?), outline: outline.clone(), + xform: FaceTransform::from_group(&group.d), svg: default(), })) },