diff options
author | 2024-03-27 19:47:48 +0900 | |
---|---|---|
committer | 2024-03-27 19:47:48 +0900 | |
commit | 19afc66cadfc7ea230d4d749b0d7b0197e29cf93 (patch) | |
tree | d012dff84003f2d7d18a1e6bc4bdac62df73b322 /widget/src/image.rs | |
parent | 4334e63ba1dd88b367f3b7f2790b7869d11d12c0 (diff) | |
parent | 1df1cf82f4c9485533f2566c8490cfe188b4ae6a (diff) | |
download | iced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.tar.gz iced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.tar.bz2 iced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.zip |
Merge branch 'master' into viewer_content_fit
Diffstat (limited to 'widget/src/image.rs')
-rw-r--r-- | widget/src/image.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/widget/src/image.rs b/widget/src/image.rs index ccf1f175..f673c7b3 100644 --- a/widget/src/image.rs +++ b/widget/src/image.rs @@ -93,7 +93,7 @@ where { // The raw w/h of the underlying image let image_size = { - let Size { width, height } = renderer.dimensions(handle); + let Size { width, height } = renderer.measure_image(handle); Size::new(width as f32, height as f32) }; @@ -130,7 +130,7 @@ pub fn draw<Renderer, Handle>( Renderer: image::Renderer<Handle = Handle>, Handle: Clone + Hash, { - let Size { width, height } = renderer.dimensions(handle); + let Size { width, height } = renderer.measure_image(handle); let image_size = Size::new(width as f32, height as f32); let bounds = layout.bounds(); @@ -148,7 +148,11 @@ pub fn draw<Renderer, Handle>( ..bounds }; - renderer.draw(handle.clone(), filter_method, drawing_bounds + offset); + renderer.draw_image( + handle.clone(), + filter_method, + drawing_bounds + offset, + ); }; if adjusted_fit.width > bounds.width || adjusted_fit.height > bounds.height |