Fixed crash when AssetViewer has size of 0 (RTFM)

This commit is contained in:
Simon Lübeß
2023-07-29 18:54:45 +02:00
parent 2838449186
commit 12d6df3edf
+5 -59
View File
@@ -31,58 +31,7 @@ class AssetViewer : EditorWindow
ImGui.PushStyleVar(.CellPadding, .(0, 0)); ImGui.PushStyleVar(.CellPadding, .(0, 0));
ImGui.Columns(2); bool alt_pressed = ImGui.GetIO().KeyAlt;
if (ImGui.BeginChild("Assets"))
{
DrawAssetList();
ImGui.EndChild();
}
ImGui.NextColumn();
if (ImGui.BeginChild("Files"))
{
DrawAssetViewer();
ImGui.EndChild();
}
ImGui.Columns(1);
/*if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
{
if (alt_pressed)
{
// Header anzeigen, damit sie neu angeordnet werden können
ImGui.TableSetupColumn("Assets");
ImGui.TableSetupColumn("Viewer");
ImGui.TableHeadersRow();
}
ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
if (ImGui.BeginChild("Assets"))
{
//DrawAssetList();
ImGui.EndChild();
}
ImGui.TableNextColumn();
if (ImGui.BeginChild("Files"))
{
//DrawAssetViewer();
ImGui.EndChild();
}
ImGui.EndTable();
}*/
/*bool alt_pressed = ImGui.GetIO().KeyAlt;
if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX)) if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
{ {
@@ -93,27 +42,24 @@ class AssetViewer : EditorWindow
ImGui.TableSetupColumn("Viewer"); ImGui.TableSetupColumn("Viewer");
ImGui.TableHeadersRow(); ImGui.TableHeadersRow();
} }
ImGui.TableNextRow(); ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0); ImGui.TableSetColumnIndex(0);
if (ImGui.BeginChild("Assets")) if (ImGui.BeginChild("Assets"))
{ DrawAssetList();
//DrawAssetList();
ImGui.EndChild(); ImGui.EndChild();
}
ImGui.TableNextColumn(); ImGui.TableNextColumn();
if (ImGui.BeginChild("Files")) if (ImGui.BeginChild("Files"))
{ DrawAssetViewer();
//DrawAssetViewer();
ImGui.EndChild(); ImGui.EndChild();
}
ImGui.EndTable(); ImGui.EndTable();
}*/ }
ImGui.PopStyleVar(1); ImGui.PopStyleVar(1);