mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-18 17:11:23 +01:00
Internals: amend RenderRectFilledRangeH() to avoid shadowed variables.
This commit is contained in:
@@ -5915,13 +5915,13 @@ static inline float ImAcos01(float x)
|
||||
// FIXME: Cleanup and move code to ImDrawList.
|
||||
// - Before 2025-12-04: RenderRectFilledRangeH() with 'float x_start_norm, float x_end_norm` <- normalized
|
||||
// - After 2025-12-04: RenderRectFilledInRangeH() with 'float x1, float x2' <- absolute coords!!
|
||||
void ImGui::RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x1, float x2, float rounding)
|
||||
void ImGui::RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float fill_x0, float fill_x1, float rounding)
|
||||
{
|
||||
if (x1 == x2)
|
||||
if (fill_x0 > fill_x1)
|
||||
return;
|
||||
|
||||
ImVec2 p0 = ImVec2(x1, rect.Min.y);
|
||||
ImVec2 p1 = ImVec2(x2, rect.Max.y);
|
||||
ImVec2 p0 = ImVec2(fill_x0, rect.Min.y);
|
||||
ImVec2 p1 = ImVec2(fill_x1, rect.Max.y);
|
||||
if (rounding == 0.0f)
|
||||
{
|
||||
draw_list->AddRectFilled(p0, p1, col, 0.0f);
|
||||
|
||||
@@ -3587,7 +3587,7 @@ namespace ImGui
|
||||
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
|
||||
IMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);
|
||||
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
|
||||
IMGUI_API void RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x1, float x2, float rounding);
|
||||
IMGUI_API void RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float fill_x0, float fill_x1, float rounding);
|
||||
IMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding);
|
||||
|
||||
// Widgets: Text
|
||||
|
||||
Reference in New Issue
Block a user