From c514ddad5402e8ca53d19948f33dcc397e58ae9b Mon Sep 17 00:00:00 2001 From: julien581 <71768120+julien581@users.noreply.github.com> Date: Wed, 23 Sep 2020 14:30:54 -0300 Subject: [PATCH] Fix for https://github.com/solvespace/solvespace/issues/248 --- src/platform/guimac.mm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/platform/guimac.mm b/src/platform/guimac.mm index 55116ea1..0f0997c4 100644 --- a/src/platform/guimac.mm +++ b/src/platform/guimac.mm @@ -458,13 +458,25 @@ MenuBarRef GetOrCreateMainMenu(bool *unique) { } } +- (void)mouseMotionEvent:(NSEvent *)nsEvent withButton:(Platform::MouseEvent::Button)button { + using Platform::MouseEvent; + + MouseEvent event = [self convertMouseEvent:nsEvent]; + event.type = MouseEvent::Type::MOTION; + event.button = button; + + if(receiver->onMouseEvent) { + receiver->onMouseEvent(event); + } +} + - (void)mouseMoved:(NSEvent *)nsEvent { [self mouseMotionEvent:nsEvent]; [super mouseMoved:nsEvent]; } - (void)mouseDragged:(NSEvent *)nsEvent { - [self mouseMotionEvent:nsEvent]; + [self mouseMotionEvent:nsEvent withButton:Platform::MouseEvent::Button::LEFT]; } - (void)otherMouseDragged:(NSEvent *)nsEvent {