From 5caa9df669a0f173fe1a7b1db6de9d3bd3a2507a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 15 May 2022 01:07:10 +0100 Subject: [PATCH] dice: Delegate our shape and bbox to outline The bbox is still wrong. Signed-off-by: Ian Jackson --- src/dice.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } } } -- 2.30.2