Skip to content

Commit

Permalink
Sandbox: ImGuiRenderer: Clamp width of title bar drag area because si…
Browse files Browse the repository at this point in the history
…ze cannot be zero.
  • Loading branch information
QueenPrinsessa committed Oct 14, 2023
1 parent 3cc2e34 commit 269b6f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Volt/Sandbox/src/Sandbox/ImGuiRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ float Sandbox::DrawTitlebar()
ImGui::SameLine();

const float w = ImGui::GetContentRegionAvail().x;
ImGui::InvisibleButton("##titlebarDragZone", ImVec2(w - buttonsAreaWidth, titlebarHeight));
const float titleBarDragWidth = w - buttonsAreaWidth;
ImGui::InvisibleButton("##titlebarDragZone", ImVec2(std::max(titleBarDragWidth, 1.0f), titlebarHeight));
myTitlebarHovered = ImGui::IsItemHovered();

ImGui::SameLine();
Expand Down

0 comments on commit 269b6f8

Please sign in to comment.