diff options
Diffstat (limited to 'graphics/src/widget/canvas.rs')
-rw-r--r-- | graphics/src/widget/canvas.rs | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/graphics/src/widget/canvas.rs b/graphics/src/widget/canvas.rs index 7897c8ec..7bf00ca5 100644 --- a/graphics/src/widget/canvas.rs +++ b/graphics/src/widget/canvas.rs @@ -3,12 +3,10 @@ //! A [`Canvas`] widget can be used to draw different kinds of 2D shapes in a //! [`Frame`]. It can be used for animation, data visualization, game graphics, //! and more! -use crate::{Backend, Defaults, Primitive, Renderer}; +use crate::{Backend, Defaults, Renderer}; use iced_native::layout; -use iced_native::mouse; use iced_native::{ - Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Size, Vector, - Widget, + Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Size, Widget, }; use std::hash::Hash; use std::marker::PhantomData; @@ -190,28 +188,29 @@ where &self, _renderer: &mut Renderer<B>, _defaults: &Defaults, - layout: Layout<'_>, - cursor_position: Point, + _layout: Layout<'_>, + _cursor_position: Point, _viewport: &Rectangle, - ) -> (Primitive, mouse::Interaction) { - let bounds = layout.bounds(); - let translation = Vector::new(bounds.x, bounds.y); - let cursor = Cursor::from_window_position(cursor_position); - - ( - Primitive::Translate { - translation, - content: Box::new(Primitive::Group { - primitives: self - .program - .draw(bounds, cursor) - .into_iter() - .map(Geometry::into_primitive) - .collect(), - }), - }, - self.program.mouse_interaction(bounds, cursor), - ) + ) { + // let bounds = layout.bounds(); + // let translation = Vector::new(bounds.x, bounds.y); + // let cursor = Cursor::from_window_position(cursor_position); + + // ( + // Primitive::Translate { + // translation, + // content: Box::new(Primitive::Group { + // primitives: self + // .program + // .draw(bounds, cursor) + // .into_iter() + // .map(Geometry::into_primitive) + // .collect(), + // }), + // }, + // self.program.mouse_interaction(bounds, cursor), + // ) + // TODO } fn hash_layout(&self, state: &mut Hasher) { |