Temporarily remove check on pointer type, we accept all possible pointers now!
This commit is contained in:
parent
95c83db203
commit
8d335c6938
|
|
@ -99,9 +99,10 @@ struct CanvasData {
|
|||
|
||||
impl Widget<CanvasData> for CanvasWidget {
|
||||
fn event<'a>(&mut self, _ctx: &mut EventCtx, event: &Event, data: &'a mut CanvasData, _env: &Env) {
|
||||
|
||||
match event {
|
||||
Event::MouseDown(mouse_event) => {
|
||||
if mouse_event.pointer_type == druid::PointerType::Stylus {
|
||||
if true /*&& mouse_event.pointer_type == druid::PointerType::Stylus || mouse_event.pointer_type == druid::PointerType::Mouse*/ {
|
||||
data.is_drawing = true;
|
||||
let mut kurbo_path = BezPath::new();
|
||||
kurbo_path.move_to((mouse_event.pos.x, mouse_event.pos.y));
|
||||
|
|
@ -110,7 +111,7 @@ impl Widget<CanvasData> for CanvasWidget {
|
|||
}
|
||||
},
|
||||
Event::MouseMove(mouse_event) => {
|
||||
if data.is_drawing && mouse_event.pointer_type == druid::PointerType::Stylus {
|
||||
if data.is_drawing /*&& (mouse_event.pointer_type == druid::PointerType::Stylus || mouse_event.pointer_type == druid::PointerType::Mouse)*/ {
|
||||
let ptr: &'a mut dyn stiletto::CanvasElement = Rc::get_mut(data.elements.back_mut().unwrap()).unwrap();
|
||||
let last_canvas_path: &'a mut stiletto::CanvasPath = ptr.get_path().unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue