Docking: Fixed amending into an existing tab bar from rendering invisible items. (#5515, amend b16f738d #2700, #2539)

Commit b16f738d left us with a "current" channel 0 which seems inadequate. Undoing that, assuming default is always 1, code filling bg color does a switch. Only DockContextEndFrame() leave it at 0 and it's not particularly necessary.
features/sdl_renderer3_multiviewports
ocornut ago%!(EXTRA string=3 years)
parent 0abe7d1cc5
commit b12e056c21
  1. 1
      docs/CHANGELOG.txt
  2. 13
      imgui.cpp

@ -145,6 +145,7 @@ Docking+Viewports Branch:
it only contained the standard Collapse/Close buttons and no actual menu. (#5463, #4792) it only contained the standard Collapse/Close buttons and no actual menu. (#5463, #4792)
- Docking: Fixed regression introduced in v1.87 when docked window content not rendered - Docking: Fixed regression introduced in v1.87 when docked window content not rendered
while switching between with CTRL+Tab. [@rokups] while switching between with CTRL+Tab. [@rokups]
- Docking: Fixed amending into an existing tab bar from rendering invisible items. (#5515)
- Backends: GLFW: Fixed leftover static variable preventing from changing or - Backends: GLFW: Fixed leftover static variable preventing from changing or
reinitializing backend while application is running. (#4616, #5434) [@rtoumazet] reinitializing backend while application is running. (#4616, #5434) [@rtoumazet]

@ -6205,14 +6205,12 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
} }
// Render, for docked windows and host windows we ensure bg goes before decorations // Render, for docked windows and host windows we ensure bg goes before decorations
if (window->DockIsActive)
window->DockNode->LastBgColor = bg_col;
ImDrawList* bg_draw_list = window->DockIsActive ? window->DockNode->HostWindow->DrawList : window->DrawList; ImDrawList* bg_draw_list = window->DockIsActive ? window->DockNode->HostWindow->DrawList : window->DrawList;
if (window->DockIsActive || (flags & ImGuiWindowFlags_DockNodeHost)) if (window->DockIsActive || (flags & ImGuiWindowFlags_DockNodeHost))
bg_draw_list->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_BG); bg_draw_list->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_BG);
if (window->DockIsActive)
window->DockNode->LastBgColor = bg_col;
bg_draw_list->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom); bg_draw_list->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 0 : ImDrawFlags_RoundCornersBottom);
if (window->DockIsActive || (flags & ImGuiWindowFlags_DockNodeHost)) if (window->DockIsActive || (flags & ImGuiWindowFlags_DockNodeHost))
bg_draw_list->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_FG); bg_draw_list->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_FG);
} }
@ -15218,7 +15216,6 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
// Update position/size, process and draw resizing splitters // Update position/size, process and draw resizing splitters
if (node->IsRootNode() && host_window) if (node->IsRootNode() && host_window)
{ {
host_window->DrawList->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_FG);
DockNodeTreeUpdatePosSize(node, host_window->Pos, host_window->Size); DockNodeTreeUpdatePosSize(node, host_window->Pos, host_window->Size);
DockNodeTreeUpdateSplitter(node); DockNodeTreeUpdateSplitter(node);
} }
@ -15283,13 +15280,7 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
// Render outer borders last (after the tab bar) // Render outer borders last (after the tab bar)
if (node->IsRootNode()) if (node->IsRootNode())
{
host_window->DrawList->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_FG);
RenderWindowOuterBorders(host_window); RenderWindowOuterBorders(host_window);
}
// Further rendering (= hosted windows background) will be drawn on layer 0
host_window->DrawList->ChannelsSetCurrent(DOCKING_HOST_DRAW_CHANNEL_BG);
} }
// End host window // End host window

Loading…
Cancel
Save