From 2887a6e07ddf09e2fbc371b1ac126795958d1cf4 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 7 Jun 2021 09:45:36 +0200 Subject: [PATCH] Tables: made TableUpdateBorders() use IsVisibleX flag. comments. --- imgui_internal.h | 4 ++-- imgui_tables.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/imgui_internal.h b/imgui_internal.h index 9d037588..e142bece 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -2066,8 +2066,8 @@ struct ImGuiTableColumn ImGuiTableColumnIdx NextEnabledColumn; // Index of next enabled/visible column within Columns[], -1 if last enabled/visible column ImGuiTableColumnIdx SortOrder; // Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort ImGuiTableDrawChannelIdx DrawChannelCurrent; // Index within DrawSplitter.Channels[] - ImGuiTableDrawChannelIdx DrawChannelFrozen; - ImGuiTableDrawChannelIdx DrawChannelUnfrozen; + ImGuiTableDrawChannelIdx DrawChannelFrozen; // Draw channels for frozen rows (often headers) + ImGuiTableDrawChannelIdx DrawChannelUnfrozen; // Draw channels for unfrozen rows bool IsEnabled; // Is the column not marked Hidden by the user? (even if off view, e.g. clipped by scrolling). bool IsEnabledNextFrame; bool IsVisibleX; // Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled). diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 8c020b95..786c7ea4 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1164,9 +1164,8 @@ void ImGui::TableUpdateBorders(ImGuiTable* table) if ((table->Flags & ImGuiTableFlags_NoBordersInBody) && table->IsUsingHeaders == false) continue; - if (table->FreezeColumnsCount > 0) - if (column->MaxX < table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsCount - 1]].MaxX) - continue; + if (!column->IsVisibleX && table->LastResizedColumn != column_n) + continue; ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent); ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);