Draft new iced_graphics crate 🎉

This commit is contained in:
Héctor Ramón Jiménez 2020-05-19 17:15:44 +02:00
parent d4743183d4
commit 05af8d00d4
100 changed files with 861 additions and 1755 deletions

View file

@ -0,0 +1,28 @@
use crate::backend::{self, Backend};
use crate::{Primitive, Renderer};
use iced_native::image;
use iced_native::mouse;
use iced_native::Layout;
impl<B> image::Renderer for Renderer<B>
where
B: Backend + backend::Image,
{
fn dimensions(&self, handle: &image::Handle) -> (u32, u32) {
self.backend().dimensions(handle)
}
fn draw(
&mut self,
handle: image::Handle,
layout: Layout<'_>,
) -> Self::Output {
(
Primitive::Image {
handle,
bounds: layout.bounds(),
},
mouse::Interaction::default(),
)
}
}