diff options
Diffstat (limited to 'graphics/src/widget/canvas')
-rw-r--r-- | graphics/src/widget/canvas/event.rs | 3 | ||||
-rw-r--r-- | graphics/src/widget/canvas/frame.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/canvas/program.rs | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/graphics/src/widget/canvas/event.rs b/graphics/src/widget/canvas/event.rs index 0e66f0ff..ede2fd73 100644 --- a/graphics/src/widget/canvas/event.rs +++ b/graphics/src/widget/canvas/event.rs @@ -1,6 +1,9 @@ +//! Handle events of a canvas. use iced_native::keyboard; use iced_native::mouse; +pub use iced_native::event::Status; + /// A [`Canvas`] event. /// /// [`Canvas`]: struct.Event.html diff --git a/graphics/src/widget/canvas/frame.rs b/graphics/src/widget/canvas/frame.rs index b5c6a2b1..21e9ec28 100644 --- a/graphics/src/widget/canvas/frame.rs +++ b/graphics/src/widget/canvas/frame.rs @@ -276,7 +276,7 @@ impl Frame { .transforms .current .raw - .pre_rotate(lyon::math::Angle::radians(-angle)); + .pre_rotate(lyon::math::Angle::radians(angle)); self.transforms.current.is_identity = false; } 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<Message> { _event: Event, _bounds: Rectangle, _cursor: Cursor, - ) -> Option<Message> { - None + ) -> (event::Status, Option<Message>) { + (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<Message> { + ) -> (event::Status, Option<Message>) { T::update(self, event, bounds, cursor) } |