DrawList: removed g_LEGACY_STROKES.

This commit is contained in:
ocornut
2026-07-28 18:27:36 +02:00
parent fe8acacdde
commit 5f7012f7ac
4 changed files with 22 additions and 110 deletions

View File

@@ -1398,9 +1398,6 @@ static const float DOCKING_TRANSPARENT_PAYLOAD_ALPHA = 0.50f; // For u
// [SECTION] FORWARD DECLARATIONS
//-------------------------------------------------------------------------
extern bool g_LEGACY_STROKES;
bool g_LEGACY_STROKES = false;
static void SetCurrentWindow(ImGuiWindow* window);
static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags);
static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window);
@@ -6107,9 +6104,6 @@ void ImGui::NewFrame()
g.DebugBeginReturnValueCullDepth = -1;
#endif
g_LEGACY_STROKES = g.IO.KeyShift;
ImGui::Checkbox("g_LEGACY_STROKES", &g_LEGACY_STROKES);
CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
}
@@ -7614,9 +7608,6 @@ static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar) && !window->DockIsActive)
{
float y = window->Pos.y + window->TitleBarHeight - 1;
if (g_LEGACY_STROKES)
window->DrawList->AddLineH(window->Pos.x + border_size * 0.5f, window->Pos.x + window->Size.x - border_size * 0.5f, y, border_col, g.Style.FrameBorderSize);
else
window->DrawList->AddLineH(window->Pos.x + border_size, window->Pos.x + window->Size.x - border_size, y, border_col, g.Style.FrameBorderSize, ImDrawFlags_StrokeCenterBiased);
}
}
@@ -7727,12 +7718,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have minimum size covering the menu bar so this is useful for them.
window->DrawList->AddRectFilled(menu_bar_rect.Min, menu_bar_rect.Max, GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawFlags_RoundCornersTop);
if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y)
{
if (g_LEGACY_STROKES)
window->DrawList->AddLineH(menu_bar_rect.Min.x + window_border_size * 0.5f, menu_bar_rect.Max.x - window_border_size * 0.5f, menu_bar_rect.Max.y, GetColorU32(ImGuiCol_Border), style.FrameBorderSize);
else
window->DrawList->AddLineH(menu_bar_rect.Min.x + window_border_size, menu_bar_rect.Max.x - window_border_size, menu_bar_rect.Max.y, GetColorU32(ImGuiCol_Border), style.FrameBorderSize, ImDrawFlags_StrokeCenterBiased);
}
}
// Docking: Unhide tab bar (small triangle in the corner), drag from small triangle to quickly undock
@@ -24268,9 +24254,6 @@ void ImGui::DebugDrawLineExtents(ImU32 col)
float line_y1 = (window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y);
float line_y2 = line_y1 + (window->DC.IsSameLine ? window->DC.PrevLineSize.y : window->DC.CurrLineSize.y);
window->DrawList->AddLineH(curr_x - 4.0f, curr_x + 5.0f, line_y1, col, 1.0f);
if (g_LEGACY_STROKES)
window->DrawList->AddLineV(curr_x - 0.5f, line_y1, line_y2, col, 1.0f);
else
window->DrawList->AddLineV(curr_x, line_y1, line_y2, col, 1.0f);
window->DrawList->AddLineH(curr_x - 4.0f, curr_x + 5.0f, line_y2, col, 1.0f);
}