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

Function RenderArrowsForVerticalBar

KBotExt/imgui/imgui_widgets.cpp:5355–5362  ·  view source on GitHub ↗

Helper for ColorPicker4()

Source from the content-addressed store, hash-verified

5353
5354// Helper for ColorPicker4()
5355static void RenderArrowsForVerticalBar(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, float bar_w, float alpha)
5356{
5357 ImU32 alpha8 = IM_F32_TO_INT8_SAT(alpha);
5358 ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + half_sz.x + 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Right, IM_COL32(0, 0, 0, alpha8));
5359 ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + half_sz.x, pos.y), half_sz, ImGuiDir_Right, IM_COL32(255, 255, 255, alpha8));
5360 ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + bar_w - half_sz.x - 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Left, IM_COL32(0, 0, 0, alpha8));
5361 ImGui::RenderArrowPointingAt(draw_list, ImVec2(pos.x + bar_w - half_sz.x, pos.y), half_sz, ImGuiDir_Left, IM_COL32(255, 255, 255, alpha8));
5362}
5363
5364// Note: ColorPicker4() only accesses 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.
5365// (In C++ the 'float col[4]' notation for a function argument is equivalent to 'float* col', we only specify a size to facilitate understanding of the code.)

Callers 1

ColorPicker4Method · 0.85

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected