diff options
Diffstat (limited to 'src/imgui_ui.cpp')
-rw-r--r-- | src/imgui_ui.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/imgui_ui.cpp b/src/imgui_ui.cpp index 5247716..77a6712 100644 --- a/src/imgui_ui.cpp +++ b/src/imgui_ui.cpp @@ -618,6 +618,7 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory, bool open = true; ImGui::Begin("Viewport", &open, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse); + if (ImGui::IsWindowHovered(ImGuiFocusedFlags_ChildWindows)) { State->FocusedWindow = focus_viewport; } @@ -628,6 +629,11 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory, ImVec2 ViewportScale = ImGui::GetContentRegionAvail(); ImVec2 ViewportMax = ImVec2(ViewportMin.x + ViewportScale.x, ViewportMin.y + ViewportScale.y); + if (ViewportScale.x < 50 || ViewportScale.y < 50) { + ImGui::End(); + return; + } + if (State->Initializing) { UI->CompZoom = ImVec2(MainComp->Width, MainComp->Height); UI->CompPos = ImVec2(ViewportMin.x + ((ViewportMax.x - ViewportMin.x)/2 - UI->CompZoom.x/2), @@ -952,6 +958,7 @@ ImGui_Popups(project_data *File, project_state *State, ui *UI, memory *Memory, I case popup_keybinds: { ImGui::OpenPopup("Keybinds"); + ImGui::SetNextWindowSize(ImVec2(700, 700)); ImGui::SetKeyboardFocusHere(); } break; default: |