Jelajahi Sumber

Fix for latest

ocornut 1 tahun lalu
induk
melakukan
4bd4b41e73
2 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 2 2
      imgui.cpp
  2. 4 0
      imgui_widgets.cpp

+ 2 - 2
imgui.cpp

@@ -6418,8 +6418,8 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
 
 
 #ifdef WIN98 // windows style title bar
 #ifdef WIN98 // windows style title bar
 
 
-    close_button_pos += ImVec2(0.0f, 2.0f);
-    collapse_button_pos += ImVec2(0.0f, 2.0f);
+    close_button_pos += ImVec2(-2.0f, -2.0f);
+    collapse_button_pos += ImVec2(-2.0f, -2.0f);
 
 
     ImU32 col_left = IM_COL32(128,128,128,255);
     ImU32 col_left = IM_COL32(128,128,128,255);
     ImU32 col_right = IM_COL32(181,181,181,255);
     ImU32 col_right = IM_COL32(181,181,181,255);

+ 4 - 0
imgui_widgets.cpp

@@ -6640,6 +6640,10 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
         float button_size = g.FontSize;
         float button_size = g.FontSize;
         float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x - button_size);
         float button_x = ImMax(g.LastItemData.Rect.Min.x, g.LastItemData.Rect.Max.x - g.Style.FramePadding.x - button_size);
         float button_y = g.LastItemData.Rect.Min.y + g.Style.FramePadding.y;
         float button_y = g.LastItemData.Rect.Min.y + g.Style.FramePadding.y;
+#ifdef WIN98
+        button_x -= 4;
+        button_y -= 1;
+#endif
         ImGuiID close_button_id = GetIDWithSeed("#CLOSE", NULL, id);
         ImGuiID close_button_id = GetIDWithSeed("#CLOSE", NULL, id);
         if (CloseButton(close_button_id, ImVec2(button_x, button_y)))
         if (CloseButton(close_button_id, ImVec2(button_x, button_y)))
             *p_visible = false;
             *p_visible = false;