|
@@ -23,6 +23,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
// CHANGELOG
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
+// 2022-11-02: Fixed mouse coordinates before clicking the host window.
|
|
// 2022-10-06: Fixed mouse inputs on flipped views.
|
|
// 2022-10-06: Fixed mouse inputs on flipped views.
|
|
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
|
|
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
|
|
// 2022-05-03: Inputs: Removed ImGui_ImplOSX_HandleEvent() from backend API in favor of backend automatically handling event capture.
|
|
// 2022-05-03: Inputs: Removed ImGui_ImplOSX_HandleEvent() from backend API in favor of backend automatically handling event capture.
|
|
@@ -631,6 +632,8 @@ static bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view)
|
|
if (event.type == NSEventTypeMouseMoved || event.type == NSEventTypeLeftMouseDragged || event.type == NSEventTypeRightMouseDragged || event.type == NSEventTypeOtherMouseDragged)
|
|
if (event.type == NSEventTypeMouseMoved || event.type == NSEventTypeLeftMouseDragged || event.type == NSEventTypeRightMouseDragged || event.type == NSEventTypeOtherMouseDragged)
|
|
{
|
|
{
|
|
NSPoint mousePoint = event.locationInWindow;
|
|
NSPoint mousePoint = event.locationInWindow;
|
|
|
|
+ if (event.window == nil)
|
|
|
|
+ mousePoint = [[view window] convertPointFromScreen:mousePoint];
|
|
mousePoint = [view convertPoint:mousePoint fromView:nil];
|
|
mousePoint = [view convertPoint:mousePoint fromView:nil];
|
|
if ([view isFlipped])
|
|
if ([view isFlipped])
|
|
mousePoint = NSMakePoint(mousePoint.x, mousePoint.y);
|
|
mousePoint = NSMakePoint(mousePoint.x, mousePoint.y);
|