DrawList: moved _GetStrokePos() to a local inline function.

This commit is contained in:
ocornut
2026-07-28 16:35:56 +02:00
parent fb9fd9a250
commit 4694b50924
2 changed files with 10 additions and 12 deletions

View File

@@ -3663,7 +3663,6 @@ struct ImDrawList
IMGUI_API void _OnChangedTexture();
IMGUI_API void _OnChangedVtxOffset();
IMGUI_API void _SetTexture(ImTextureRef tex_ref);
IMGUI_API ImDrawFlags _GetStrokePos(ImDrawFlags flags, ImDrawFlags default_stroke_pos);
IMGUI_API int _CalcCircleAutoSegmentCount(float radius) const;
IMGUI_API void _PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step);
IMGUI_API void _PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments);

View File

@@ -931,6 +931,16 @@ void ImDrawList::_SelectFringeTexture(float screen_thickness, ImVec4* out_tex_uv
// Scale the fringe so that the texture matches the line thickness.
*out_fringe = _FringeScale * screen_thickness * tex_uvs.w; // tex_uvs.w = 1 / thickness
}
// We intently don't turn g_LEGACY_STROKES into ImDrawFlags_StrokeLegacy here.
// The earlier should use verbatim legacy code but will be removed before release once we confirm that both matches.
static inline ImDrawFlags _GetStrokePos(ImDrawFlags flags, ImDrawFlags default_stroke_pos)
{
if (flags & ImDrawFlags_StrokeMask_)
return (flags & ImDrawFlags_StrokeMask_);
return default_stroke_pos;
}
IM_MSVC_RUNTIME_CHECKS_RESTORE
extern bool g_LEGACY_STROKES;
@@ -2195,17 +2205,6 @@ void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDr
}
}
// We intently don't turn g_LEGACY_STROKES into ImDrawFlags_StrokeLegacy here.
// The earlier should use verbatim legacy code but will be removed before release once we confirm that both matches.
IM_MSVC_RUNTIME_CHECKS_OFF
ImDrawFlags ImDrawList::_GetStrokePos(ImDrawFlags flags, ImDrawFlags default_stroke_pos)
{
if (flags & ImDrawFlags_StrokeMask_)
return (flags & ImDrawFlags_StrokeMask_);
return default_stroke_pos;
}
IM_MSVC_RUNTIME_CHECKS_RESTORE
void ImDrawList::_AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness, ImDrawFlags flags)
{
if (g_LEGACY_STROKES) IM_UNLIKELY