mirror of
https://github.com/xemu-project/imgui.git
synced 2024-11-23 18:29:51 +00:00
Internals: Removed unused ShadeVertsLinearAlphaGradientForLeftToRightText code.
This commit is contained in:
parent
42bf149ac6
commit
93950b8c32
@ -1267,23 +1267,6 @@ void ImGui::ShadeVertsLinearColorGradientKeepAlpha(ImDrawVert* vert_start, ImDra
|
||||
}
|
||||
}
|
||||
|
||||
// Scan and shade backward from the end of given vertices. Assume vertices are text only (= vert_start..vert_end going left to right) so we can break as soon as we are out the gradient bounds.
|
||||
void ImGui::ShadeVertsLinearAlphaGradientForLeftToRightText(ImDrawVert* vert_start, ImDrawVert* vert_end, float gradient_p0_x, float gradient_p1_x)
|
||||
{
|
||||
float gradient_extent_x = gradient_p1_x - gradient_p0_x;
|
||||
float gradient_inv_length2 = 1.0f / (gradient_extent_x * gradient_extent_x);
|
||||
int full_alpha_count = 0;
|
||||
for (ImDrawVert* vert = vert_end - 1; vert >= vert_start; vert--)
|
||||
{
|
||||
float d = (vert->pos.x - gradient_p0_x) * (gradient_extent_x);
|
||||
float alpha_mul = 1.0f - ImClamp(d * gradient_inv_length2, 0.0f, 1.0f);
|
||||
if (alpha_mul >= 1.0f && ++full_alpha_count > 2)
|
||||
return; // Early out
|
||||
int a = (int)(((vert->col >> IM_COL32_A_SHIFT) & 0xFF) * alpha_mul);
|
||||
vert->col = (vert->col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT);
|
||||
}
|
||||
}
|
||||
|
||||
// Distribute UV over (a, b) rectangle
|
||||
void ImGui::ShadeVertsLinearUV(ImDrawVert* vert_start, ImDrawVert* vert_end, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp)
|
||||
{
|
||||
|
@ -1175,7 +1175,6 @@ namespace ImGui
|
||||
|
||||
// Shade functions (write over already created vertices)
|
||||
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawVert* vert_start, ImDrawVert* vert_end, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
|
||||
IMGUI_API void ShadeVertsLinearAlphaGradientForLeftToRightText(ImDrawVert* vert_start, ImDrawVert* vert_end, float gradient_p0_x, float gradient_p1_x);
|
||||
IMGUI_API void ShadeVertsLinearUV(ImDrawVert* vert_start, ImDrawVert* vert_end, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);
|
||||
|
||||
} // namespace ImGui
|
||||
|
Loading…
Reference in New Issue
Block a user