MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / AddImageRounded

Method AddImageRounded

TheForceEngine/TFE_Ui/imGUI/imgui_draw.cpp:1689–1713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1687}
1688
1689void 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)
1690{
1691 if ((col & IM_COL32_A_MASK) == 0)
1692 return;
1693
1694 flags = FixRectCornerFlags(flags);
1695 if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
1696 {
1697 AddImage(user_texture_id, p_min, p_max, uv_min, uv_max, col);
1698 return;
1699 }
1700
1701 const bool push_texture_id = user_texture_id != _CmdHeader.TextureId;
1702 if (push_texture_id)
1703 PushTextureID(user_texture_id);
1704
1705 int vert_start_idx = VtxBuffer.Size;
1706 PathRect(p_min, p_max, rounding, flags);
1707 PathFillConvex(col);
1708 int vert_end_idx = VtxBuffer.Size;
1709 ImGui::ShadeVertsLinearUV(this, vert_start_idx, vert_end_idx, p_min, p_max, uv_min, uv_max, true);
1710
1711 if (push_texture_id)
1712 PopTextureID();
1713}
1714
1715//-----------------------------------------------------------------------------
1716// [SECTION] ImTriangulator, ImDrawList concave polygon fill

Callers 2

modLoader_imageListUIFunction · 0.80
modLoader_selectionUIFunction · 0.80

Calls 1

FixRectCornerFlagsFunction · 0.85

Tested by

no test coverage detected