chiark / gitweb /
dice: Delegate our shape and bbox to outline
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 May 2022 00:07:10 +0000 (01:07 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 May 2022 00:07:10 +0000 (01:07 +0100)
The bbox is still wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/dice.rs

index 2b307bbaeb0ea66b16f5f72f0a3bf08ccb4a43a3..cae6969f2694870993b2837f8b4dcb2f7bde8c50 100644 (file)
@@ -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<Rect, IE>;
+      fn shape(&self) -> Option<Shape>;
+    }
+  }
+
   delegate! {
     to self.image {
       // `outline_path` won't be called at all,
       // since we provide `surround_path`
       fn outline_path(&self, scale: f64) -> Result<Html, IE>;
       fn thresh_dragraise(&self) -> Result<Option<Coord>, IE>;
-      fn bbox_approx(&self) -> Result<Rect, IE>;
-      fn shape(&self) -> Option<Shape>;
     }
   }
 }