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

Method CalcCustomRectUV

KBotExt/imgui/imgui_draw.cpp:2277–2283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2275}
2276
2277void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const
2278{
2279 IM_ASSERT(TexWidth > 0 && TexHeight > 0); // Font atlas needs to be built before we can calculate UV coordinates
2280 IM_ASSERT(rect->IsPacked()); // Make sure the rectangle has been packed
2281 *out_uv_min = ImVec2((float)rect->X * TexUvScale.x, (float)rect->Y * TexUvScale.y);
2282 *out_uv_max = ImVec2((float)(rect->X + rect->Width) * TexUvScale.x, (float)(rect->Y + rect->Height) * TexUvScale.y);
2283}
2284
2285bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
2286{

Callers 1

ImFontAtlasBuildFinishFunction · 0.80

Calls 2

ImVec2Function · 0.85
IsPackedMethod · 0.80

Tested by

no test coverage detected