TreeNode, Tables: fixed ImGuiTreeNodeFlags_DrawLinesXXX feature when TreePop() is called in table: in no column or at top of row. (#2920)
This commit is contained in:
+7
-2
@@ -55,8 +55,8 @@ Other changes:
|
|||||||
- Windows: loosened code to allow hovering of resize grips, borders, and table
|
- Windows: loosened code to allow hovering of resize grips, borders, and table
|
||||||
borders while hovering a sibling child window, so that the code in master matches
|
borders while hovering a sibling child window, so that the code in master matches
|
||||||
one in docking (they accidentally diverged). (#8554)
|
one in docking (they accidentally diverged). (#8554)
|
||||||
- TreeNode: added flags to draw tree hierarchy outlines linking parent
|
- TreeNode: added experimental flags to draw tree hierarchy outlines linking
|
||||||
and tree nodes: (#2920)
|
parent and tree nodes: (#2920)
|
||||||
- ImGuiTreeNodeFlags_DrawLinesNone: No lines drawn (default value in style.TreeLinesFlags).
|
- ImGuiTreeNodeFlags_DrawLinesNone: No lines drawn (default value in style.TreeLinesFlags).
|
||||||
- ImGuiTreeNodeFlags_DrawLinesFull: Horizontal lines to child nodes. Vertical line drawn down to TreePop() position: cover full contents.
|
- ImGuiTreeNodeFlags_DrawLinesFull: Horizontal lines to child nodes. Vertical line drawn down to TreePop() position: cover full contents.
|
||||||
- ImGuiTreeNodeFlags_DrawLinesToNodes: Horizontal lines to child nodes. Vertical line drawn down to bottom-most child node.
|
- ImGuiTreeNodeFlags_DrawLinesToNodes: Horizontal lines to child nodes. Vertical line drawn down to bottom-most child node.
|
||||||
@@ -69,6 +69,11 @@ Other changes:
|
|||||||
nodes in unusual ways, using indent to create tree-looking structures, etc.)
|
nodes in unusual ways, using indent to create tree-looking structures, etc.)
|
||||||
and the feature may not accurately represent them in every cases.
|
and the feature may not accurately represent them in every cases.
|
||||||
- The feature adds a little cost as extra data needs to be stored.
|
- The feature adds a little cost as extra data needs to be stored.
|
||||||
|
(ImGuiTreeNodeFlags_DrawLinesToNodes is slower than ImGuiTreeNodeFlags_DrawLinesFull
|
||||||
|
which may be meaningful on very large trees, as it needs to record bottom-most
|
||||||
|
Y position even for clipped nodes).
|
||||||
|
- The feature is unlikely to ever work properly when using a coarse clipper
|
||||||
|
such as ImGuiListClipper.
|
||||||
- TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns.
|
- TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns.
|
||||||
- Nav: fixed assertion when holding gamepad FaceLeft/West button to open
|
- Nav: fixed assertion when holding gamepad FaceLeft/West button to open
|
||||||
CTRL+Tab windowing + pressing a keyboard key. (#8525)
|
CTRL+Tab windowing + pressing a keyboard key. (#8525)
|
||||||
|
|||||||
+1
-1
@@ -2494,7 +2494,7 @@ void ImGui::TablePopColumnChannel()
|
|||||||
ImGuiTable* table = g.CurrentTable;
|
ImGuiTable* table = g.CurrentTable;
|
||||||
|
|
||||||
// Optimization: avoid PopClipRect() + SetCurrentChannel()
|
// Optimization: avoid PopClipRect() + SetCurrentChannel()
|
||||||
if (table->Flags & ImGuiTableFlags_NoClip)
|
if ((table->Flags & ImGuiTableFlags_NoClip) || (table->CurrentColumn == -1)) // Calling TreePop() after TableNextRow() is supported.
|
||||||
return;
|
return;
|
||||||
ImGuiWindow* window = g.CurrentWindow;
|
ImGuiWindow* window = g.CurrentWindow;
|
||||||
const ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
|
const ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
|
||||||
|
|||||||
+4
-1
@@ -6919,7 +6919,10 @@ void ImGui::TreePop()
|
|||||||
float y2 = data->DrawLinesToNodesY2;
|
float y2 = data->DrawLinesToNodesY2;
|
||||||
if (data->TreeFlags & ImGuiTreeNodeFlags_DrawLinesFull)
|
if (data->TreeFlags & ImGuiTreeNodeFlags_DrawLinesFull)
|
||||||
{
|
{
|
||||||
float y2_full = ImTrunc(window->DC.CursorPos.y - g.Style.ItemSpacing.y - g.FontSize * 0.5f);
|
float y2_full = window->DC.CursorPos.y;
|
||||||
|
if (g.CurrentTable)
|
||||||
|
y2_full = ImMax(g.CurrentTable->RowPosY2, y2_full);
|
||||||
|
y2_full = ImTrunc(y2_full - g.Style.ItemSpacing.y - g.FontSize * 0.5f);
|
||||||
if (y2 + g.Style.ItemSpacing.y < y2_full) // FIXME: threshold to use ToNodes Y2 instead of Full Y2 when close by ItemSpacing.y
|
if (y2 + g.Style.ItemSpacing.y < y2_full) // FIXME: threshold to use ToNodes Y2 instead of Full Y2 when close by ItemSpacing.y
|
||||||
y2 = y2_full;
|
y2 = y2_full;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user