qtimgui
qtimgui copied to clipboard
Mac os display error!
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.
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);
This simple patch should fix the issue. Scaling works differently on MacOS than other platforms.