From e53119464df03cfb0d36a885958003634b8aef79 Mon Sep 17 00:00:00 2001 From: lazypassion <25536767+lazypassion@users.noreply.github.com> Date: Wed, 6 Jan 2021 12:29:09 -0500 Subject: [PATCH] implementing data trait for ImageBuf --- druid/src/data.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/druid/src/data.rs b/druid/src/data.rs index 764c79a431..6986173067 100644 --- a/druid/src/data.rs +++ b/druid/src/data.rs @@ -23,6 +23,7 @@ use crate::piet; use crate::shell::Scale; pub use druid_derive::Data; +use piet::ImageBuf; /// A trait used to represent value types. /// @@ -434,6 +435,12 @@ impl Data for piet::TextAlignment { } } +impl Data for ImageBuf { + fn same(&self, other: &Self) -> bool { + self.raw_pixels_shared().same(&other.raw_pixels_shared()) + } +} + #[cfg(feature = "im")] impl Data for im::Vector { fn same(&self, other: &Self) -> bool {