CollapsingHeader/TreeNode: Fixed text padding when using _Framed+_Leaf flags. (#6549)

This commit is contained in:
ocornut
2023-06-26 11:14:51 +02:00
parent 6b2e03c5b1
commit 0a53b45858
2 changed files with 4 additions and 2 deletions

View File

@ -6262,7 +6262,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
else if (!is_leaf)
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 1.0f);
else // Leaf without bullet, left-adjusted text
text_pos.x -= text_offset_x;
text_pos.x -= text_offset_x -padding.x;
if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton)
frame_bb.Max.x -= g.FontSize + style.FramePadding.x;