MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / AddImageRounded

Method AddImageRounded

plugins/Cardinal/src/DearImGui/imgui_draw.cpp:1642–1666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1640}
1641
1642void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags)
1643{
1644 if ((col & IM_COL32_A_MASK) == 0)
1645 return;
1646
1647 flags = FixRectCornerFlags(flags);
1648 if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
1649 {
1650 AddImage(user_texture_id, p_min, p_max, uv_min, uv_max, col);
1651 return;
1652 }
1653
1654 const bool push_texture_id = user_texture_id != _CmdHeader.TextureId;
1655 if (push_texture_id)
1656 PushTextureID(user_texture_id);
1657
1658 int vert_start_idx = VtxBuffer.Size;
1659 PathRect(p_min, p_max, rounding, flags);
1660 PathFillConvex(col);
1661 int vert_end_idx = VtxBuffer.Size;
1662 ImGui::ShadeVertsLinearUV(this, vert_start_idx, vert_end_idx, p_min, p_max, uv_min, uv_max, true);
1663
1664 if (push_texture_id)
1665 PopTextureID();
1666}
1667
1668
1669//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

FixRectCornerFlagsFunction · 0.85

Tested by

no test coverage detected