MCPcopy Create free account
hub / github.com/cinder/Cinder / GetCustomRect

Method GetCustomRect

src/imgui/imgui_draw.cpp:3325–3340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3323#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3324
3325bool ImFontAtlas::GetCustomRect(ImFontAtlasRectId id, ImFontAtlasRect* out_r) const
3326{
3327 ImTextureRect* r = ImFontAtlasPackGetRectSafe((ImFontAtlas*)this, id);
3328 if (r == NULL)
3329 return false;
3330 IM_ASSERT(TexData->Width > 0 && TexData->Height > 0); // Font atlas needs to be built before we can calculate UV coordinates
3331 if (out_r == NULL)
3332 return true;
3333 out_r->x = r->x;
3334 out_r->y = r->y;
3335 out_r->w = r->w;
3336 out_r->h = r->h;
3337 out_r->uv0 = ImVec2((float)(r->x), (float)(r->y)) * TexUvScale;
3338 out_r->uv1 = ImVec2((float)(r->x + r->w), (float)(r->y + r->h)) * TexUvScale;
3339 return true;
3340}
3341
3342bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
3343{

Callers 3

ShowFontAtlasMethod · 0.80

Calls 2

ImVec2Function · 0.85

Tested by

no test coverage detected