Docking: Fixed overlapping issue with greyed out close button.

This commit is contained in:
omar 2019-01-23 13:03:59 +01:00
parent 9f96fcff3c
commit 0bda7f196d

View File

@ -11561,8 +11561,8 @@ static ImRect ImGui::DockNodeCalcTabBarRect(const ImGuiDockNode* node)
ImRect r = ImRect(node->Pos.x, node->Pos.y, node->Pos.x + node->Size.x, node->Pos.y + (g.FontSize + g.Style.FramePadding.y * 2.0f)); ImRect r = ImRect(node->Pos.x, node->Pos.y, node->Pos.x + node->Size.x, node->Pos.y + (g.FontSize + g.Style.FramePadding.y * 2.0f));
if (node->HasCollapseButton) if (node->HasCollapseButton)
r.Min.x += g.Style.FramePadding.x + g.FontSize; // + g.Style.ItemInnerSpacing.x; // <-- Adding ItemInnerSpacing makes the title text moves slightly when in a tab bar. Instead we adjusted RenderArrowDockMenu() r.Min.x += g.Style.FramePadding.x + g.FontSize; // + g.Style.ItemInnerSpacing.x; // <-- Adding ItemInnerSpacing makes the title text moves slightly when in a tab bar. Instead we adjusted RenderArrowDockMenu()
if (node->HasCloseButton) // In DockNodeUpdateTabBar() we currently display a disabled close button even if there is none.
r.Max.x -= g.Style.FramePadding.x + g.FontSize + 1.0f; r.Max.x -= g.Style.FramePadding.x + g.FontSize + 1.0f;
return r; return r;
} }