mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-16 10:42:35 +01:00
MenuBar clipping rectangle fix for bordered mode
This commit is contained in:
parent
b49a985324
commit
56c4f5b7dc
@ -8275,7 +8275,8 @@ bool ImGui::BeginMenuBar()
|
|||||||
ImGui::BeginGroup(); // Save position
|
ImGui::BeginGroup(); // Save position
|
||||||
ImGui::PushID("##menubar");
|
ImGui::PushID("##menubar");
|
||||||
ImRect rect = window->MenuBarRect();
|
ImRect rect = window->MenuBarRect();
|
||||||
PushClipRect(ImVec4(rect.Min.x+0.5f, rect.Min.y-0.5f, rect.Max.x+0.5f, rect.Max.y-1.5f), false);
|
float border_size = (window->Flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
|
||||||
|
PushClipRect(ImVec4(rect.Min.x+0.5f, rect.Min.y-0.5f+border_size, rect.Max.x+0.5f, rect.Max.y-0.5f), false);
|
||||||
window->DC.CursorPos = ImVec2(rect.Min.x + window->DC.MenuBarOffsetX, rect.Min.y);// + g.Style.FramePadding.y);
|
window->DC.CursorPos = ImVec2(rect.Min.x + window->DC.MenuBarOffsetX, rect.Min.y);// + g.Style.FramePadding.y);
|
||||||
window->DC.LayoutType = ImGuiLayoutType_Horizontal;
|
window->DC.LayoutType = ImGuiLayoutType_Horizontal;
|
||||||
window->DC.MenuBarAppending = true;
|
window->DC.MenuBarAppending = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user