mirror of
https://github.com/ocornut/imgui.git
synced 2026-04-02 13:37:40 -05:00
Fonts: Made it possible to use PushFont()/PopFont() calls accross Begin() calls. (#3224, #3875, #6398, #7903)
This commit is contained in:
@@ -526,7 +526,6 @@ void ImDrawList::_OnChangedClipRect()
|
||||
CmdBuffer.pop_back();
|
||||
return;
|
||||
}
|
||||
|
||||
curr_cmd->ClipRect = _CmdHeader.ClipRect;
|
||||
}
|
||||
|
||||
@@ -549,7 +548,6 @@ void ImDrawList::_OnChangedTextureID()
|
||||
CmdBuffer.pop_back();
|
||||
return;
|
||||
}
|
||||
|
||||
curr_cmd->TextureId = _CmdHeader.TextureId;
|
||||
}
|
||||
|
||||
@@ -625,6 +623,15 @@ void ImDrawList::PopTextureID()
|
||||
_OnChangedTextureID();
|
||||
}
|
||||
|
||||
// This is used by ImGui::PushFont()/PopFont(). It works because we never use _TextureIdStack[] elsewhere than in PushTextureID()/PopTextureID().
|
||||
void ImDrawList::_SetTextureID(ImTextureID texture_id)
|
||||
{
|
||||
if (_CmdHeader.TextureId == texture_id)
|
||||
return;
|
||||
_CmdHeader.TextureId = texture_id;
|
||||
_OnChangedTextureID();
|
||||
}
|
||||
|
||||
// Reserve space for a number of vertices and indices.
|
||||
// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or
|
||||
// submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
|
||||
|
||||
Reference in New Issue
Block a user