From: Ian Jackson Date: Sun, 15 May 2022 00:07:10 +0000 (+0100) Subject: dice: Delegate our shape and bbox to outline X-Git-Tag: otter-1.1.0~150 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5caa9df669a0f173fe1a7b1db6de9d3bd3a2507a;p=otter.git dice: Delegate our shape and bbox to outline The bbox is still wrong. Signed-off-by: Ian Jackson --- diff --git a/src/dice.rs b/src/dice.rs index 2b307bba..cae6969f 100644 --- a/src/dice.rs +++ b/src/dice.rs @@ -315,14 +315,19 @@ impl OutlineTrait for Die { #[throws(IE)] fn surround_path(&self) -> Html { self.surround_outline.outline_path(1.0)? } + delegate! { + to self.surround_outline { + fn bbox_approx(&self) -> Result; + fn shape(&self) -> Option; + } + } + delegate! { to self.image { // `outline_path` won't be called at all, // since we provide `surround_path` fn outline_path(&self, scale: f64) -> Result; fn thresh_dragraise(&self) -> Result, IE>; - fn bbox_approx(&self) -> Result; - fn shape(&self) -> Option; } } }