From f962ca0b0135aee66b5ce394507a0d473c6af603 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 27 Oct 2017 20:36:51 +0200 Subject: [PATCH] ColorTooltip: Resize ColorButton to align better with text, now that ColorButton provides a text baseline (0260fdd1c6c7198d60fcbd02cce82e4deb8954f4) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index b9f54ff0..0c2e72a5 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9303,7 +9303,7 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags Separator(); } - ImVec2 sz(g.FontSize * 3, g.FontSize * 3); + ImVec2 sz(g.FontSize * 3 + g.Style.FramePadding.y * 2, g.FontSize * 3 + g.Style.FramePadding.y * 2); ColorButton("##preview", ImVec4(col[0], col[1], col[2], col[3]), (flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz); SameLine(); if (flags & ImGuiColorEditFlags_NoAlpha)