@ -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 )
{