mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-02 19:16:49 +08: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:
@@ -60,6 +60,9 @@ Other Changes:
|
|||||||
resizing the parent window while keeping the multi-line field active (which is
|
resizing the parent window while keeping the multi-line field active (which is
|
||||||
most typically achieved when resizing programmatically or via a docking layout
|
most typically achieved when resizing programmatically or via a docking layout
|
||||||
reacting to a platform window resize). (#3237, #9007) [@anton-kl, @ocornut]
|
reacting to a platform window resize). (#3237, #9007) [@anton-kl, @ocornut]
|
||||||
|
- Textures:
|
||||||
|
- Fixed an issue preventing multi-contexts from using each others' fonts
|
||||||
|
if context 2 runs after context 1's Render() function. (#9039)
|
||||||
- MultiSelect: added ImGuiMultiSelectFlags_NoSelectOnRightClick to disable default
|
- MultiSelect: added ImGuiMultiSelectFlags_NoSelectOnRightClick to disable default
|
||||||
right-click processing, which selects item on mouse down and is designed for
|
right-click processing, which selects item on mouse down and is designed for
|
||||||
context-menus. (#8200, #9015)
|
context-menus. (#8200, #9015)
|
||||||
|
|||||||
@@ -3909,6 +3909,11 @@ void ImFontAtlasRemoveDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedDat
|
|||||||
void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex, ImTextureRef new_tex)
|
void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex, ImTextureRef new_tex)
|
||||||
{
|
{
|
||||||
for (ImDrawListSharedData* shared_data : atlas->DrawListSharedDatas)
|
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)
|
for (ImDrawList* draw_list : shared_data->DrawLists)
|
||||||
{
|
{
|
||||||
// Replace in command-buffer
|
// Replace in command-buffer
|
||||||
@@ -3922,6 +3927,7 @@ void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex
|
|||||||
if (stacked_tex == old_tex)
|
if (stacked_tex == old_tex)
|
||||||
stacked_tex = new_tex;
|
stacked_tex = new_tex;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update texture coordinates in all draw list shared context
|
// Update texture coordinates in all draw list shared context
|
||||||
|
|||||||
Reference in New Issue
Block a user