From 842cd2ec9418e64911c60588fe70a1ce9c45a1b7 Mon Sep 17 00:00:00 2001 From: Ashley Wulber <48420062+wash2@users.noreply.github.com> Date: Wed, 30 Oct 2024 06:00:30 -0400 Subject: [PATCH] fix: specify width and height when importing raster images --- src/widget/icon/handle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/icon/handle.rs b/src/widget/icon/handle.rs index fe325908..3a2db2c9 100644 --- a/src/widget/icon/handle.rs +++ b/src/widget/icon/handle.rs @@ -74,8 +74,8 @@ pub fn from_raster_pixels( Handle { symbolic: false, data: match pixels.into() { - Cow::Owned(pixels) => Data::Image(image::Handle::from_bytes(pixels)), - Cow::Borrowed(pixels) => Data::Image(image::Handle::from_bytes(pixels)), + Cow::Owned(pixels) => Data::Image(image::Handle::from_rgba(width, height, pixels)), + Cow::Borrowed(pixels) => Data::Image(image::Handle::from_rgba(width, height, pixels)), }, } }