Decouple the image Handle type from the iced_native implementation
This commit is contained in:
parent
8cbba94458
commit
a7bcd65bb8
4 changed files with 37 additions and 24 deletions
|
|
@ -115,10 +115,15 @@ impl std::fmt::Debug for Data {
|
|||
///
|
||||
/// [renderer]: crate::renderer
|
||||
pub trait Renderer: crate::Renderer {
|
||||
/// The image Handle to be displayed. Iced exposes its own default implementation of a [`Handle`]
|
||||
///
|
||||
/// [`Handle`]: Self::Handle
|
||||
type Handle: Clone + Hash;
|
||||
|
||||
/// Returns the dimensions of an image for the given [`Handle`].
|
||||
fn dimensions(&self, handle: &Handle) -> (u32, u32);
|
||||
fn dimensions(&self, handle: &Self::Handle) -> (u32, u32);
|
||||
|
||||
/// Draws an image with the given [`Handle`] and inside the provided
|
||||
/// `bounds`.
|
||||
fn draw(&mut self, handle: Handle, bounds: Rectangle);
|
||||
fn draw(&mut self, handle: Self::Handle, bounds: Rectangle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue