From 12d6df3edf79caff82b51e67026040515bfdd7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sat, 29 Jul 2023 18:54:45 +0200 Subject: [PATCH] Fixed crash when AssetViewer has size of 0 (RTFM) --- GlitchyEditor/src/EditWindows/AssetViewer.bf | 72 +++----------------- 1 file changed, 9 insertions(+), 63 deletions(-) diff --git a/GlitchyEditor/src/EditWindows/AssetViewer.bf b/GlitchyEditor/src/EditWindows/AssetViewer.bf index 0e109a9..77da6f8 100644 --- a/GlitchyEditor/src/EditWindows/AssetViewer.bf +++ b/GlitchyEditor/src/EditWindows/AssetViewer.bf @@ -31,58 +31,7 @@ class AssetViewer : EditorWindow ImGui.PushStyleVar(.CellPadding, .(0, 0)); - ImGui.Columns(2); - - 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; + bool alt_pressed = ImGui.GetIO().KeyAlt; if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX)) { @@ -93,27 +42,24 @@ class AssetViewer : EditorWindow ImGui.TableSetupColumn("Viewer"); ImGui.TableHeadersRow(); } + ImGui.TableNextRow(); ImGui.TableSetColumnIndex(0); - - if (ImGui.BeginChild("Assets")) - { - //DrawAssetList(); - ImGui.EndChild(); - } + if (ImGui.BeginChild("Assets")) + DrawAssetList(); + + ImGui.EndChild(); ImGui.TableNextColumn(); if (ImGui.BeginChild("Files")) - { - //DrawAssetViewer(); + DrawAssetViewer(); - ImGui.EndChild(); - } + ImGui.EndChild(); ImGui.EndTable(); - }*/ + } ImGui.PopStyleVar(1);