2
0
Эх сурвалжийг харах

ColorTooltip: Resize ColorButton to align better with text, now that ColorButton provides a text baseline (0260fdd1c6c7198d60fcbd02cce82e4deb8954f4)

omar 8 жил өмнө
parent
commit
f962ca0b01
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      imgui.cpp

+ 1 - 1
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)