-
-
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
Bug with AddRectFilled/WindowDrawList? #811
Comments
By default the window pushes a clipping rectangle (ImGui::PushClipRect / ImDrawList::PushClipRect) with that amount of padding. The half WindowPadding match the amount that e.g. CollapsingHeader uses to extend itself slightly If you want to draw fullscreen or go off the current clipping rectangle you can call
Drawing commands are processed in order within a window (there's a channel split api for out of order rendering but it isn't what you want there), and then child window are drawn after their parent. There's no explicit finer control of z-ordering yet, but if you have child windows and you want your rectangle to draw over them, a workaround is to create a final child window, push a fullscreen clip rectangle and draw there. There's an OverlayDrawList in imgui_internal.h (not exposed yet) which is basically just a ImDrawList that drawn last. Or you can either create your own ImDrawList. You can inspect the draw order in the metrics window (call |
Will do today, after i update it a little.. as for docking ImWindow looks nice but too complex and lumix does look nice too but doesnt allow docking out of platform window like imWindow does, does have one frame lag to compute dock sizes i guess which i dont like xD and they both lack more control about initial positioning and sizing.. so i wrote my docking, currently around 500loc and when finished around 600 combined for header+source file and have a lot more of control over layout |
is your docking code available? |
Please move this to the other thread as well, so people can find it :) |
@nem0 not yet, its not ready, after i finish it i will release it on my github and link it in #351 , used simple buttons for prototyping for tabbar so have to rewrite that and have to figure how to dock from one platform window to another, then clean the code a little.. but it wont be too hard i guess/hope, also to mention it does not follow imgui style, docks are not resubmited every frame for example and i use std::function but that could be easily changed to function pointers.. now.. moving to the other thread :) |
Hi Omar, thanks for this awesome gui lib.. started using it few days ago for writing my 3D editor so its maybe my lack of knowledge and done by design or possible bug?
im rendering 2 imgui windows, one for titlebar and one for workspace so it draws only one part of the red square using:
ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(), ImVec2(100,110), ImGui::ColorConvertFloat4ToU32(ImVec4(1, .15, .15, 1)));
and thats fine but there is an offset in x as you can see in the picture and its always half of ImGuiStyleVar_WindowPadding..
if its by design is there a way to draw the rect from 0,0?
I used 24,0 just for debuging for ImGuiStyleVar_WindowPadding and the child is drawn at 24 but the AddRectFilled at 12..
Another question is how to force GetWindowDrawList to draw on top of everything? it draws on top of buttons but behind child windows as in the pic even if the AddRectFilled is called after everything else..
The text was updated successfully, but these errors were encountered: