| 158 | } |
| 159 | |
| 160 | IMPLOT_INLINE void GetLineRenderProps(const ImDrawList& draw_list, float& half_weight, ImVec2& tex_uv0, ImVec2& tex_uv1) { |
| 161 | const bool aa = ImHasFlag(draw_list.Flags, ImDrawListFlags_AntiAliasedLines) && |
| 162 | ImHasFlag(draw_list.Flags, ImDrawListFlags_AntiAliasedLinesUseTex); |
| 163 | if (aa) { |
| 164 | ImVec4 tex_uvs = draw_list._Data->TexUvLines[(int)(half_weight*2)]; |
| 165 | tex_uv0 = ImVec2(tex_uvs.x, tex_uvs.y); |
| 166 | tex_uv1 = ImVec2(tex_uvs.z, tex_uvs.w); |
| 167 | half_weight += 1; |
| 168 | } |
| 169 | else { |
| 170 | tex_uv0 = tex_uv1 = draw_list._Data->TexUvWhitePixel; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | IMPLOT_INLINE void PrimLine(ImDrawList& draw_list, const ImVec2& P1, const ImVec2& P2, float half_weight, ImU32 col, const ImVec2& tex_uv0, const ImVec2 tex_uv1) { |
| 175 | float dx = P2.x - P1.x; |