Implement event capturing for Canvas
This commit is contained in:
parent
bf6c65b5ad
commit
3aca177132
5 changed files with 98 additions and 66 deletions
|
|
@ -16,11 +16,11 @@ use iced_native::{
|
|||
use std::hash::Hash;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub mod event;
|
||||
pub mod path;
|
||||
|
||||
mod cache;
|
||||
mod cursor;
|
||||
mod event;
|
||||
mod fill;
|
||||
mod frame;
|
||||
mod geometry;
|
||||
|
|
@ -184,11 +184,14 @@ where
|
|||
let cursor = Cursor::from_window_position(cursor_position);
|
||||
|
||||
if let Some(canvas_event) = canvas_event {
|
||||
if let Some(message) =
|
||||
self.program.update(canvas_event, bounds, cursor)
|
||||
{
|
||||
let (event_status, message) =
|
||||
self.program.update(canvas_event, bounds, cursor);
|
||||
|
||||
if let Some(message) = message {
|
||||
messages.push(message);
|
||||
}
|
||||
|
||||
return event_status;
|
||||
}
|
||||
|
||||
event::Status::Ignored
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue