Merge pull request #10459 from AlexKornitzer/feature/cocoa-fix

ui_cocoa: fix mouse input for cocoa
This commit is contained in:
Autechre 2020-04-17 01:49:38 +02:00 committed by GitHub
commit 51183787af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,7 @@ static void app_terminate(void)
#if defined(HAVE_COCOA_METAL)
pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
#elif defined(HAVE_COCOA)
pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
#endif
apple->touches[0].screen_x = (int16_t)pos.x;
apple->touches[0].screen_y = (int16_t)pos.y;
@ -172,6 +173,7 @@ static void app_terminate(void)
if (!apple || pos.y < 0)
return;
apple->mouse_buttons |= (1 << event.buttonNumber);
apple->touch_count = 1;
}
break;
case NSEventTypeLeftMouseUp: