From 09a6bcfffc24f5abdc8709403bab7ae1e01563f1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 May 2024 13:15:17 +0200 Subject: Add `Image` rotation support Co-authored-by: DKolter <68352124+DKolter@users.noreply.github.com> --- widget/src/image/viewer.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widget/src/image/viewer.rs') diff --git a/widget/src/image/viewer.rs b/widget/src/image/viewer.rs index 214cb996..ccdfdebb 100644 --- a/widget/src/image/viewer.rs +++ b/widget/src/image/viewer.rs @@ -341,6 +341,8 @@ where y: bounds.y, ..Rectangle::with_size(image_size) }, + 0.0, + Size::UNIT, ); }); }); -- cgit From a57313b23ecb9843856ca0ea08635b6121fcb2cb Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 2 May 2024 15:21:22 +0200 Subject: Simplify image rotation API and its internals --- widget/src/image/viewer.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'widget/src/image/viewer.rs') diff --git a/widget/src/image/viewer.rs b/widget/src/image/viewer.rs index ccdfdebb..ee4c0fba 100644 --- a/widget/src/image/viewer.rs +++ b/widget/src/image/viewer.rs @@ -6,8 +6,8 @@ use crate::core::mouse; use crate::core::renderer; use crate::core::widget::tree::{self, Tree}; use crate::core::{ - Clipboard, Element, Layout, Length, Pixels, Point, Rectangle, Shell, Size, - Vector, Widget, + Clipboard, Element, Layout, Length, Pixels, Point, Radians, Rectangle, + Shell, Size, Vector, Widget, }; /// A frame that displays an image with the ability to zoom in/out and pan. @@ -341,8 +341,7 @@ where y: bounds.y, ..Rectangle::with_size(image_size) }, - 0.0, - Size::UNIT, + Radians(0.0), ); }); }); -- cgit