瀏覽代碼

Demo: Assets Browser: use correct axis for layout computation, to allow making items non-square. (#8207)

Jack Holmes 8 月之前
父節點
當前提交
6f6ac84228
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      imgui_demo.cpp

+ 1 - 1
imgui_demo.cpp

@@ -10175,7 +10175,7 @@ struct ExampleAssetsBrowser
         }
 
         ImGuiIO& io = ImGui::GetIO();
-        ImGui::SetNextWindowContentSize(ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.x + LayoutItemSpacing)));
+        ImGui::SetNextWindowContentSize(ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.y + LayoutItemSpacing)));
         if (ImGui::BeginChild("Assets", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Borders, ImGuiWindowFlags_NoMove))
         {
             ImDrawList* draw_list = ImGui::GetWindowDrawList();