qtimgui icon indicating copy to clipboard operation
qtimgui copied to clipboard

Mac os display error!

Open custstu opened this issue 9 months ago • 2 comments

截屏2024-05-03 上午12 41 56

on Mac os. the contents on the window don't display normally. It display only when I drag the window to the top left corner of the big main window.

custstu avatar May 02 '24 16:05 custstu

After commenting the line “draw_data->ScaleClipRects(io.DisplayFramebufferScale);” in renderDrawList. It displays normally on Macos.

void ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
{
    // Select current context
    ImGui::SetCurrentContext(g_ctx);

    // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
    const ImGuiIO& io = ImGui::GetIO();
    int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x);
    int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y);
    if (fb_width == 0 || fb_height == 0)
        return;
    //draw_data->ScaleClipRects(io.DisplayFramebufferScale);

custstu avatar May 04 '24 23:05 custstu

This simple patch should fix the issue. Scaling works differently on MacOS than other platforms.

0001-Address-clipping-error-on-MacOS-Issue-56.patch

OskarLinde avatar Sep 12 '24 13:09 OskarLinde