From d1211b7157d83729057147eaad716f6511c394a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Thu, 2 Apr 2026 19:17:23 +0200 Subject: [PATCH] fix(texture): display inf rec --- src/raytracer/texture.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/raytracer/texture.rs b/src/raytracer/texture.rs index 3d90710..df57216 100644 --- a/src/raytracer/texture.rs +++ b/src/raytracer/texture.rs @@ -14,7 +14,7 @@ pub trait Texture: Display + Debug + AsAny + Sync + Send { fn material_at(&self, pt: Point2) -> Material; } -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct TextureWrapper(Arc); impl TextureWrapper { @@ -25,7 +25,13 @@ impl TextureWrapper { impl Display for TextureWrapper { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Display::fmt(&self, f) + Display::fmt(&self.0, f) + } +} + +impl Debug for TextureWrapper { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + Debug::fmt(&self.0, f) } } @@ -114,7 +120,7 @@ impl Debug for MandelbrotTexture { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "MandelbrotTexture{{at={}, max_iter={}}}", + "MandelbrotTexture{{at={:?}, max_iter={:?}}}", self.at, self.max_iter ) }