mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-01 17:44:33 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user