1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Fonts: rename internal fields for consistency.

This commit is contained in:
ocornut 2025-10-31 16:16:45 +01:00
parent 149587b85b
commit db577cd445
4 changed files with 34 additions and 34 deletions

View file

@ -7804,7 +7804,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Setup draw list and outer clipping rectangle
IM_ASSERT(window->DrawList->CmdBuffer.Size == 1 && window->DrawList->CmdBuffer[0].ElemCount == 0);
window->DrawList->PushTexture(g.Font->ContainerAtlas->TexRef);
window->DrawList->PushTexture(g.Font->OwnerAtlas->TexRef);
PushClipRect(host_rect.Min, host_rect.Max, false);
// Child windows can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call (since 1.71)
@ -8906,7 +8906,7 @@ void ImGui::SetCurrentFont(ImFont* font, float font_size_before_scaling, float f
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
IM_ASSERT(font->Scale > 0.0f);
#endif
ImFontAtlas* atlas = font->ContainerAtlas;
ImFontAtlas* atlas = font->OwnerAtlas;
g.DrawListSharedData.FontAtlas = atlas;
g.DrawListSharedData.Font = font;
ImFontAtlasUpdateDrawListsSharedData(atlas);
@ -17083,7 +17083,7 @@ void ImGui::DebugNodeFont(ImFont* font)
{
ImGuiContext& g = *GImGui;
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
ImFontAtlas* atlas = font->ContainerAtlas;
ImFontAtlas* atlas = font->OwnerAtlas;
bool opened = TreeNode(font, "Font: \"%s\": %d sources(s)", font->GetDebugName(), font->Sources.Size);
// Display preview text
@ -17198,7 +17198,7 @@ void ImGui::DebugNodeFont(ImFont* font)
for (int baked_n = 0; baked_n < atlas->Builder->BakedPool.Size; baked_n++)
{
ImFontBaked* baked = &atlas->Builder->BakedPool[baked_n];
if (baked->ContainerFont != font)
if (baked->OwnerFont != font)
continue;
PushID(baked_n);
if (TreeNode("Glyphs", "Baked at { %.2fpx, d.%.2f }: %d glyphs%s", baked->Size, baked->RasterizerDensity, baked->Glyphs.Size, (baked->LastUsedFrame < atlas->Builder->FrameCount - 1) ? " *Unused*" : ""))
@ -17289,7 +17289,7 @@ void ImGui::DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph)
Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
if (glyph->PackId >= 0)
{
ImTextureRect* r = ImFontAtlasPackGetRect(font->ContainerAtlas, glyph->PackId);
ImTextureRect* r = ImFontAtlasPackGetRect(font->OwnerAtlas, glyph->PackId);
Text("PackId: 0x%X (%dx%d rect at %d,%d)", glyph->PackId, r->w, r->h, r->x, r->y);
}
Text("SourceIdx: %d", glyph->SourceIdx);