Skip to content

Commit bbb0f0a

Browse files
committed
TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns.
1 parent 43caca0 commit bbb0f0a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Other changes:
6969
nodes in unusual ways, using indent to create tree-looking structures, etc.)
7070
and the feature may not accurately represent them in every cases.
7171
- The feature adds a little cost as extra data needs to be stored.
72+
- TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns.
7273
- Nav: fixed assertion when holding gamepad FaceLeft/West button to open
7374
CTRL+Tab windowing + pressing a keyboard key. (#8525)
7475
- Error Handling: added better error report and recovery for extraneous

imgui_widgets.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -6794,6 +6794,8 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
67946794
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
67956795
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding);
67966796
RenderNavCursor(frame_bb, id, nav_render_cursor_flags);
6797+
if (span_all_columns && !span_all_columns_label)
6798+
TablePopBackgroundChannel();
67976799
if (flags & ImGuiTreeNodeFlags_Bullet)
67986800
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col);
67996801
else if (!is_leaf)
@@ -6814,6 +6816,8 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
68146816
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
68156817
}
68166818
RenderNavCursor(frame_bb, id, nav_render_cursor_flags);
6819+
if (span_all_columns && !span_all_columns_label)
6820+
TablePopBackgroundChannel();
68176821
if (flags & ImGuiTreeNodeFlags_Bullet)
68186822
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
68196823
else if (!is_leaf)
@@ -6825,9 +6829,6 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
68256829
if (draw_tree_lines)
68266830
TreeNodeDrawLineToChildNode(ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.5f));
68276831

6828-
if (span_all_columns && !span_all_columns_label)
6829-
TablePopBackgroundChannel();
6830-
68316832
// Label
68326833
if (display_frame)
68336834
RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size);

0 commit comments

Comments
 (0)