-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Docking windows that have a minimum size causes incorrect clipping rect #2690
Comments
Nice find, odd bug.. in Begin() adding those two lines should fix it:
Would that be an acceptable fix short-term? (I don't have an ETA for docking handling constraint at window-level... it is kind of a hairy problem as windows with varied constraints may be docked in the same location.. toggling their visiblity would affect the docking tree every time..). I think perhaps a healthier way of supporting them is that the constraints wouldn't affect the size of the docking node, but the space the window would be allowed to occupy within the space of that node would be affected by the constraint (so some space in the docking node may be unused). |
Thanks Omar, I've confirmed that your patch has fixed this for us. |
, #2109, #2906) In #2906 the zero input came from a minimized viewport, but even without it we cannot prevent DockNode size from eventually reaching zero as padding are taken from the starting size. In a separate commit we'll however shortcut some of the existing codepath on zero-sized viewport to reduce the likehood of lossy side-effects (just like we don't call ClampWindowRect in Begin)
Version/Branch of Dear ImGui:
Version: 1.72 WIP (17102)
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp
Compiler: Visual C++ 2017
Operating System: Windows 10
If you have a window that's set to have a minimum size, then dock the window and shrink it smaller than that minimum size, the content clip rect seems to be set to the minimum size, rather than the size enforced on the window by the dock node.
In the example project, I've created a simple window with a large button, and set a min/max constraint on it:
Then used the demo window's Examples -> Dockspace menu to enable a full-screen dockspace, and dragged the window to the left edge, and shrunk the dock node's width to less than 300px. Notice that the button's text is visible outside the window, and the button's hover shading is too; clipping at around 300px from the edge of the screen.
I'm unsure whether there's a core problem that the dock node should respect the window's constraints and stop you from shrinking it so small, but it shouldn't be allowing the window to draw outside its bounds either way.
The text was updated successfully, but these errors were encountered: