Skip to content

Commit

Permalink
fix ImGui_ImplOSX_GetWindowSize and ConvertNSRect
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkosivulainen committed Dec 20, 2022
1 parent c191faf commit 506c6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backends/imgui_impl_osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ - (BOOL)canBecomeKeyWindow

static void ConvertNSRect(NSScreen* screen, NSRect* r)
{
r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height;
r->origin.y = screen.frame.size.height - r->origin.y - r->size.height;
}

static void ImGui_ImplOSX_CreateWindow(ImGuiViewport* viewport)
Expand Down Expand Up @@ -924,7 +924,7 @@ static ImVec2 ImGui_ImplOSX_GetWindowSize(ImGuiViewport* viewport)

NSWindow* window = data->Window;
NSSize size = window.contentLayoutRect.size;
return ImVec2(size.width, size.width);
return ImVec2(size.width, size.height);
}

static void ImGui_ImplOSX_SetWindowSize(ImGuiViewport* viewport, ImVec2 size)
Expand Down

0 comments on commit 506c6b8

Please sign in to comment.