summaryrefslogtreecommitdiffstats
path: root/graphics/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 17:01:23 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 17:01:23 +0700
commit8b1587421822d9a0e7fa1c2224447da7007dbd30 (patch)
tree5234edce7f3c3fb96afeaf5c3c7301e659babb2e /graphics/src
parent1ec667920a792dbe96786a44b8b3064cae7eaea2 (diff)
downloadiced-8b1587421822d9a0e7fa1c2224447da7007dbd30.tar.gz
iced-8b1587421822d9a0e7fa1c2224447da7007dbd30.tar.bz2
iced-8b1587421822d9a0e7fa1c2224447da7007dbd30.zip
Implement `Widget::draw` for `image::Viewer`
Diffstat (limited to 'graphics/src')
-rw-r--r--graphics/src/widget/image.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/graphics/src/widget/image.rs b/graphics/src/widget/image.rs
index dc2d1657..242d36d7 100644
--- a/graphics/src/widget/image.rs
+++ b/graphics/src/widget/image.rs
@@ -2,10 +2,9 @@
pub mod viewer;
use crate::backend::{self, Backend};
+use crate::{Primitive, Rectangle, Renderer};
-use crate::{Primitive, Renderer};
use iced_native::image;
-use iced_native::Layout;
pub use iced_native::image::{Handle, Image, Viewer};
@@ -17,10 +16,7 @@ where
self.backend().dimensions(handle)
}
- fn draw(&mut self, handle: image::Handle, layout: Layout<'_>) {
- self.draw_primitive(Primitive::Image {
- handle,
- bounds: layout.bounds(),
- })
+ fn draw(&mut self, handle: image::Handle, bounds: Rectangle) {
+ self.draw_primitive(Primitive::Image { handle, bounds })
}
}