Rename and add to iced image module

This commit is contained in:
Cory Forsstrom 2020-05-15 09:46:22 -07:00
parent 6bf459e068
commit 431171f975
No known key found for this signature in database
GPG key ID: 64D6B5851FFCAC9E
7 changed files with 58 additions and 56 deletions

View file

@ -18,4 +18,4 @@ mod svg;
#[cfg(feature = "image")]
mod image;
#[cfg(feature = "image")]
mod image_pane;
mod image_viewer;

View file

@ -1,10 +1,10 @@
use crate::{Primitive, Renderer};
use iced_native::{image, image_pane, mouse, Rectangle, Vector};
use iced_native::{image, image_viewer, mouse, Rectangle, Vector};
impl image_pane::Renderer for Renderer {
impl image_viewer::Renderer for Renderer {
fn draw(
&mut self,
state: &image_pane::State,
state: &image_viewer::State,
bounds: Rectangle,
image_bounds: Rectangle,
offset: (u32, u32),

View file

@ -50,8 +50,8 @@ pub use canvas::Canvas;
#[cfg(feature = "image")]
#[doc(no_inline)]
pub mod image_pane;
pub mod image_viewer;
#[cfg(feature = "image")]
#[doc(no_inline)]
pub use image_pane::ImagePane;
pub use image_viewer::ImageViewer;

View file

@ -1,6 +1,6 @@
//! Zoom and pan on an image.
pub use iced_native::image_pane::State;
pub use iced_native::image_viewer::State;
/// A widget that can display an image with the ability to zoom in/out and pan.
pub type ImagePane<'a> = iced_native::ImagePane<'a>;
pub type ImageViewer<'a> = iced_native::ImageViewer<'a>;