Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state
| 3810 | |
| 3811 | // Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state |
| 3812 | void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale) |
| 3813 | { |
| 3814 | const float h = draw_list->_Data->FontSize * 1.00f; |
| 3815 | float r = h * 0.40f * scale; |
| 3816 | ImVec2 center = pos + ImVec2(h * 0.50f, h * 0.50f * scale); |
| 3817 | |
| 3818 | ImVec2 a, b, c; |
| 3819 | switch (dir) |
| 3820 | { |
| 3821 | case ImGuiDir_Up: |
| 3822 | case ImGuiDir_Down: |
| 3823 | if (dir == ImGuiDir_Up) r = -r; |
| 3824 | a = ImVec2(+0.000f, +0.750f) * r; |
| 3825 | b = ImVec2(-0.866f, -0.750f) * r; |
| 3826 | c = ImVec2(+0.866f, -0.750f) * r; |
| 3827 | break; |
| 3828 | case ImGuiDir_Left: |
| 3829 | case ImGuiDir_Right: |
| 3830 | if (dir == ImGuiDir_Left) r = -r; |
| 3831 | a = ImVec2(+0.750f, +0.000f) * r; |
| 3832 | b = ImVec2(-0.750f, +0.866f) * r; |
| 3833 | c = ImVec2(-0.750f, -0.866f) * r; |
| 3834 | break; |
| 3835 | case ImGuiDir_None: |
| 3836 | case ImGuiDir_COUNT: |
| 3837 | IM_ASSERT(0); |
| 3838 | break; |
| 3839 | } |
| 3840 | draw_list->AddTriangleFilled(center + a, center + b, center + c, col); |
| 3841 | } |
| 3842 | |
| 3843 | void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col) |
| 3844 | { |
nothing calls this directly
no test coverage detected