MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / RenderArrowPointingAt

Method RenderArrowPointingAt

KBotExt/imgui/imgui_draw.cpp:3865–3875  ·  view source on GitHub ↗

Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.

Source from the content-addressed store, hash-verified

3863
3864// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
3865void ImGui::RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col)
3866{
3867 switch (direction)
3868 {
3869 case ImGuiDir_Left: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), pos, col); return;
3870 case ImGuiDir_Right: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), pos, col); return;
3871 case ImGuiDir_Up: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), pos, col); return;
3872 case ImGuiDir_Down: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), pos, col); return;
3873 case ImGuiDir_None: case ImGuiDir_COUNT: break; // Fix warnings
3874 }
3875}
3876
3877static inline float ImAcos01(float x)
3878{

Callers

nothing calls this directly

Calls 2

ImVec2Function · 0.85
AddTriangleFilledMethod · 0.80

Tested by

no test coverage detected