Skip to content

Commit

Permalink
Lower-right resize grip only appears when hovered. (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Dec 6, 2017
1 parent 3b7e4ea commit ecacaf7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4602,7 +4602,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if (hovered || held)
g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;

if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0])
if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0)
{
// Manual auto-fit when double-clicking
size_target = CalcSizeFullWithConstraint(window, size_auto_fit);
Expand All @@ -4615,7 +4615,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
ImVec2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + resize_rect.GetSize() * grip.CornerPos; // Corner of the window corresponding to our corner grip
CalcResizePosSizeFromAnyCorner(window, corner_target, grip.CornerPos, &pos_target, &size_target);
}
resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip);
if (resize_grip_n == 0 || held || hovered)
resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip);
}
for (int border_n = 0; border_n < resize_border_count; border_n++)
{
Expand Down

0 comments on commit ecacaf7

Please sign in to comment.