From 3aca1771329cf7845cbc6c98e536cfb6c0e7c3ff Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 12 Nov 2020 01:24:59 +0100 Subject: Implement event capturing for `Canvas` --- graphics/src/widget/canvas/program.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'graphics/src/widget/canvas/program.rs') diff --git a/graphics/src/widget/canvas/program.rs b/graphics/src/widget/canvas/program.rs index 725d9d72..e8f43380 100644 --- a/graphics/src/widget/canvas/program.rs +++ b/graphics/src/widget/canvas/program.rs @@ -1,4 +1,5 @@ -use crate::canvas::{Cursor, Event, Geometry}; +use crate::canvas::event::{self, Event}; +use crate::canvas::{Cursor, Geometry}; use iced_native::{mouse, Rectangle}; /// The state and logic of a [`Canvas`]. @@ -27,8 +28,8 @@ pub trait Program { _event: Event, _bounds: Rectangle, _cursor: Cursor, - ) -> Option { - None + ) -> (event::Status, Option) { + (event::Status::Ignored, None) } /// Draws the state of the [`Program`], producing a bunch of [`Geometry`]. @@ -67,7 +68,7 @@ where event: Event, bounds: Rectangle, cursor: Cursor, - ) -> Option { + ) -> (event::Status, Option) { T::update(self, event, bounds, cursor) } -- cgit