mirror of https://github.com/ocornut/imgui
PathArcToFast: Minor renaming for clarification. Comments.
This commit is contained in:
parent
8c61a4eb4c
commit
6a4064e5f2
|
@ -4388,7 +4388,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
|
|||
bg_color_idx = ImGuiCol_PopupBg;
|
||||
else if ((flags & ImGuiWindowFlags_ChildWindow) != 0)
|
||||
bg_color_idx = ImGuiCol_ChildWindowBg;
|
||||
ImVec4 bg_color = style.Colors[bg_color_idx];
|
||||
ImVec4 bg_color = style.Colors[bg_color_idx]; // We don't use GetColorU32() because bg_alpha is assigned (not multiplied) below
|
||||
if (bg_alpha >= 0.0f)
|
||||
bg_color.w = bg_alpha;
|
||||
bg_color.w *= style.Alpha;
|
||||
|
|
|
@ -678,7 +678,7 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
|
|||
}
|
||||
}
|
||||
|
||||
void ImDrawList::PathArcToFast(const ImVec2& centre, float radius, int amin, int amax)
|
||||
void ImDrawList::PathArcToFast(const ImVec2& centre, float radius, int a_min_of_12, int a_max_of_12)
|
||||
{
|
||||
static ImVec2 circle_vtx[12];
|
||||
static bool circle_vtx_builds = false;
|
||||
|
@ -694,15 +694,15 @@ void ImDrawList::PathArcToFast(const ImVec2& centre, float radius, int amin, int
|
|||
circle_vtx_builds = true;
|
||||
}
|
||||
|
||||
if (amin > amax) return;
|
||||
if (a_min_of_12 > a_max_of_12) return;
|
||||
if (radius == 0.0f)
|
||||
{
|
||||
_Path.push_back(centre);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Path.reserve(_Path.Size + (amax - amin + 1));
|
||||
for (int a = amin; a <= amax; a++)
|
||||
_Path.reserve(_Path.Size + (a_max_of_12 - a_min_of_12 + 1));
|
||||
for (int a = a_min_of_12; a <= a_max_of_12; a++)
|
||||
{
|
||||
const ImVec2& c = circle_vtx[a % circle_vtx_count];
|
||||
_Path.push_back(ImVec2(centre.x + c.x * radius, centre.y + c.y * radius));
|
||||
|
|
Loading…
Reference in New Issue