Internal: CloseButton takes an upper-left corner + a size to be consistent with similar widgets.

This commit is contained in:
omar
2019-05-24 17:47:51 +02:00
parent ec3ec24157
commit 6c3697f6f1
4 changed files with 20 additions and 14 deletions

View File

@ -5074,8 +5074,8 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
// Close button
if (p_open != NULL)
{
const float rad = g.FontSize * 0.5f;
if (CloseButton(window->GetID("#CLOSE"), ImVec2(window->Pos.x + window->Size.x - style.FramePadding.x - rad, window->Pos.y + style.FramePadding.y + rad), rad + 1))
const float button_sz = g.FontSize;
if (CloseButton(window->GetID("#CLOSE"), ImVec2(window->Pos.x + window->Size.x - style.FramePadding.x * 2.0f - button_sz, window->Pos.y)))
*p_open = false;
}