mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Textures: fixed an issue preventing multi-contexts from using each others' fonts if context 2 runs after context 1's Render() function. (#9039)
This commit is contained in:
parent
db577cd445
commit
505ff536f9
2 changed files with 9 additions and 0 deletions
|
|
@ -3909,6 +3909,11 @@ void ImFontAtlasRemoveDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedDat
|
|||
void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex, ImTextureRef new_tex)
|
||||
{
|
||||
for (ImDrawListSharedData* shared_data : atlas->DrawListSharedDatas)
|
||||
{
|
||||
// If Context 2 uses font owned by Context 1 which already called EndFrame()/Render(), we don't want to mess with draw commands for Context 1
|
||||
if (shared_data->Context && !shared_data->Context->WithinFrameScope)
|
||||
continue;
|
||||
|
||||
for (ImDrawList* draw_list : shared_data->DrawLists)
|
||||
{
|
||||
// Replace in command-buffer
|
||||
|
|
@ -3922,6 +3927,7 @@ void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex
|
|||
if (stacked_tex == old_tex)
|
||||
stacked_tex = new_tex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update texture coordinates in all draw list shared context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue