-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClipRect not honored / Overlapping text over docked window borders #7742
Comments
Looks like a problem with scissor rects not being set up correctly. Have you modified the render backend in any way or do you use an outdated one by accident? Do you use draw list callbacks that could mess up the render state? |
There's a possibility this is affected by the different resolution between render target and window size on a Mac with Retina display, but since the provided screenshot appears to be near the top-left of window it may not be this. See if things look different on all 4 corners of the window. We do this in // Will project scissor/clipping rectangles into framebuffer space
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2) // Project scissor/clipping rectangles into framebuffer space
ImVec2 clip_min((pcmd->ClipRect.x - clip_off.x) * clip_scale.x, (pcmd->ClipRect.y - clip_off.y) * clip_scale.y);
ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y);
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
// Apply scissor/clipping rectangle (Y is inverted in OpenGL)
GL_CALL(glScissor((int)clip_min.x, (int)((float)fb_height - clip_max.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y))); Can you verify the value of // Setup display size (every frame to accommodate for window resizing)
int w, h;
int display_w, display_h;
glfwGetWindowSize(bd->Window, &w, &h);
glfwGetFramebufferSize(bd->Window, &display_w, &display_h);
io.DisplaySize = ImVec2((float)w, (float)h);
if (w > 0 && h > 0)
io.DisplayFramebufferScale = ImVec2((float)display_w / (float)w, (float)display_h / (float)h); And on a Mac this should set |
It may be also good to clarify if this ONLY happens on docked window border as you stated (vs also happening e.g. on any window will scrollable contents). If it does ONLY happens on docked windows as you stated, it may be another cause. Please also open |
Thanks a lot for the quick answers. I forgot to mention that you can try it out in the browser in our WebAssembly-Emscripten-GLFW-WebGL version on: https://pallas.ti.bfh.ch/slproject/ By the way, Thanks a lot for ImGui and your amazing work! |
I guess I'm using an outdated OpenGL3 ImGui rendering. |
Version/Branch of Dear ImGui:
Version 1.90.8, Branch: docking
Back-ends:
imgui_impl_opengl3.cpp
Compiler, OS:
clang, MacOS
Full config/build information:
Details:
In docked windows, I'm getting overlapping text into other windows in the same dock. See the red rectangles in the image as soon as getting scrollbars on the right side when the content no longer fits the window height. You can see the font settings on the right side of the screenshot. They are not influencing the problem. The overlap happens anyway.
I searched everywhere with the text "ImGui: Overlapping text over docked windows borders".
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: