TreePush: removed arbitrary/weird suppot for TreePush((const char*)NULL)

This commit is contained in:
ocornut 2021-09-15 12:12:49 +02:00
parent 7b8bc864e9
commit 4f10fe0a27
3 changed files with 8 additions and 3 deletions

View File

@ -56,6 +56,11 @@ Other Changes:
the arrow section of TreeNode(), the +/- buttons of InputInt()/InputFloat(), Selectable() with
ImGuiSelectableFlags_SelectOnRelease. More generally: any direct use of ButtonBehavior() with
the PressedOnClick/PressedOnDoubleClick/PressedOnRelease button policy.
- TreePush(): removed unnecessary/inconsistent legacy behavior where passing a NULL value to
the TreePush(const char*) and TreePush(const void*) functions would use an hardcoded replacement.
The only situation where that change would make a meaningful difference is TreePush((const char*)NULL)
(_explicitely_ casting a null pointer to const char*), which is unlikely and will now crash.
You may replace it with anything else.
- Menus: Fixed vertical alignments of MenuItem() calls within a menu bar. (broken in 1.84). (#4538)
- Menus: Adjust closing logic to accomodate for varying font size and dpi.
- Menus: Fixed crash when navigating left inside a child window inside a sub-menu. (#4510).

View File

@ -162,7 +162,7 @@ Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-lik
---
### Q: I integrated Dear ImGui in my engine and little squares are showing instead of text...
Your renderer is not using the font texture correctly or it hasn't be uploaded to GPU.
Your renderer is not using the font texture correctly or it hasn't been uploaded to the GPU.
- If this happens using the standard backends: A) have you modified the font atlas after `ImGui_ImplXXX_NewFrame()`? B) maybe the texture failed to upload, which could happens if for some reason your texture is too big. Also see [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md).
- If this happens with a custom backend: make sure you have uploaded the font texture to the GPU, that all shaders are rendering states are setup properly (e.g. texture is bound). Compare your code to existing backends and use a graphics debugger such as [RenderDoc](https://renderdoc.org) to debug your rendering states.

View File

@ -5983,7 +5983,7 @@ void ImGui::TreePush(const char* str_id)
ImGuiWindow* window = GetCurrentWindow();
Indent();
window->DC.TreeDepth++;
PushID(str_id ? str_id : "#TreePush");
PushID(str_id);
}
void ImGui::TreePush(const void* ptr_id)
@ -5991,7 +5991,7 @@ void ImGui::TreePush(const void* ptr_id)
ImGuiWindow* window = GetCurrentWindow();
Indent();
window->DC.TreeDepth++;
PushID(ptr_id ? ptr_id : (const void*)"#TreePush");
PushID(ptr_id);
}
void ImGui::TreePushOverrideID(ImGuiID id)