TreeNode: Added support for ImGuiTreeNodeFlags_UpsideDownArrow in frameless tree nodes (#6517, #6538)

This commit is contained in:
Krzysztof Adamek 2023-06-20 12:07:25 +02:00 committed by ocornut
parent e0583975cd
commit 959a9c79bd

View File

@ -6281,7 +6281,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
if (flags & ImGuiTreeNodeFlags_Bullet) if (flags & ImGuiTreeNodeFlags_Bullet)
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col); RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
else if (!is_leaf) else if (!is_leaf)
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f); RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f);
if (g.LogEnabled) if (g.LogEnabled)
LogSetNextTextDecoration(">", NULL); LogSetNextTextDecoration(">", NULL);
RenderText(text_pos, label, label_end, false); RenderText(text_pos, label, label_end, false);