Introduce Image struct in core::image

This commit is contained in:
Héctor Ramón Jiménez 2024-08-04 04:30:12 +02:00
parent 974ae6d1e7
commit 92bd3ecd6b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
19 changed files with 184 additions and 334 deletions

View file

@ -8,8 +8,8 @@ use crate::core::mouse;
use crate::core::renderer;
use crate::core::widget::Tree;
use crate::core::{
ContentFit, Element, Layout, Length, Point, Rectangle, Rotation, Size,
Vector, Widget,
self, ContentFit, Element, Layout, Length, Point, Rectangle, Rotation,
Size, Vector, Widget,
};
pub use image::{FilterMethod, Handle};
@ -181,11 +181,14 @@ pub fn draw<Renderer, Handle>(
let render = |renderer: &mut Renderer| {
renderer.draw_image(
handle.clone(),
filter_method,
core::Image {
handle: handle.clone(),
filter_method,
rotation: rotation.radians(),
opacity,
snap: true,
},
drawing_bounds,
rotation.radians(),
opacity,
);
};