@@ -1107,8 +1107,8 @@ static void UpdateKeyRoutingTable(ImGuiKeyRoutingTable* rt);
1107
1107
// Misc
1108
1108
static void UpdateSettings();
1109
1109
static int UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_hovered, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect);
1110
- static void RenderWindowOuterBorders(ImGuiWindow* window, int border_hovered, int border_held );
1111
- static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size, int border_hovered, int border_held );
1110
+ static void RenderWindowOuterBorders(ImGuiWindow* window);
1111
+ static void RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size);
1112
1112
static void RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& title_bar_rect, const char* name, bool* p_open);
1113
1113
static void RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col);
1114
1114
static void RenderDimmedBackgrounds();
@@ -6089,20 +6089,20 @@ static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_
6089
6089
window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
6090
6090
}
6091
6091
6092
- static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window, int border_hovered, int border_held )
6092
+ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
6093
6093
{
6094
6094
ImGuiContext& g = *GImGui;
6095
6095
float rounding = window->WindowRounding;
6096
6096
float border_size = window->WindowBorderSize;
6097
6097
if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground))
6098
6098
window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
6099
6099
6100
- if (border_hovered != -1 || border_held != -1)
6100
+ if (window->ResizeBorderHovered != -1 || window->ResizeBorderHeld != -1)
6101
6101
{
6102
- const int border_n = (border_held != -1) ? border_held : border_hovered ;
6102
+ const int border_n = (window->ResizeBorderHeld != -1) ? window->ResizeBorderHeld : window->ResizeBorderHovered ;
6103
6103
const ImGuiResizeBorderDef& def = resize_border_def[border_n];
6104
6104
const ImRect border_r = GetResizeBorderRect(window, border_n, rounding, 0.0f);
6105
- const ImU32 border_col = GetColorU32((border_held != -1) ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered);
6105
+ const ImU32 border_col = GetColorU32((window->ResizeBorderHeld != -1) ? ImGuiCol_SeparatorActive : ImGuiCol_SeparatorHovered);
6106
6106
window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle);
6107
6107
window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f);
6108
6108
window->DrawList->PathStroke(border_col, 0, ImMax(2.0f, border_size)); // Thicker than usual
@@ -6116,7 +6116,7 @@ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window, int border_hove
6116
6116
6117
6117
// Draw background and borders
6118
6118
// Draw and handle scrollbars
6119
- void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size, int border_hovered, int border_held )
6119
+ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar_rect, bool title_bar_is_highlight, bool handle_borders_and_resize_grips, int resize_grip_count, const ImU32 resize_grip_col[4], float resize_grip_draw_size)
6120
6120
{
6121
6121
ImGuiContext& g = *GImGui;
6122
6122
ImGuiStyle& style = g.Style;
@@ -6199,7 +6199,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
6199
6199
6200
6200
// Borders
6201
6201
if (handle_borders_and_resize_grips)
6202
- RenderWindowOuterBorders(window, border_hovered, border_held );
6202
+ RenderWindowOuterBorders(window);
6203
6203
}
6204
6204
}
6205
6205
@@ -6742,6 +6742,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
6742
6742
if (auto_fit_mask & (1 << ImGuiAxis_Y))
6743
6743
use_current_size_for_scrollbar_y = true;
6744
6744
}
6745
+ window->ResizeBorderHovered = (signed char)border_hovered;
6746
+ window->ResizeBorderHeld = (signed char)border_held;
6745
6747
6746
6748
// SCROLLBAR VISIBILITY
6747
6749
@@ -6856,7 +6858,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
6856
6858
const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow;
6857
6859
const bool title_bar_is_highlight = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight);
6858
6860
const bool handle_borders_and_resize_grips = true; // This exists to facilitate merge with 'docking' branch.
6859
- RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size, border_hovered, border_held );
6861
+ RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size);
6860
6862
6861
6863
if (render_decorations_in_parent)
6862
6864
window->DrawList = &window->DrawListInst;
0 commit comments