Browse Source

Tables: fixed auto-width columns when using synced-instances of same table. (#7218)

Amend d3c3514a5
ocornut 11 months ago
parent
commit
e648dbb59d
2 changed files with 3 additions and 1 deletions
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui_tables.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -71,6 +71,8 @@ Other changes:
   (e.g. in our testing, handling of a 1 MB text buffer is now 3 times faster in VS2022 Debug build).
   (e.g. in our testing, handling of a 1 MB text buffer is now 3 times faster in VS2022 Debug build).
   This is the first step toward more refactoring. (#7925) [@alektron, @ocornut]
   This is the first step toward more refactoring. (#7925) [@alektron, @ocornut]
 - InputText: added CJK double-width punctuation to list of separators considered for CTRL+Arrow.
 - InputText: added CJK double-width punctuation to list of separators considered for CTRL+Arrow.
+- Tables: fixed auto-width columns when using synced-instances of same table. The previous fix
+  done in v1.90.5 was incomplete. (#7218)
 - Tables: fixed assertion related to inconsistent outer clipping when sizes are not rounded. (#7957) [@eclbtownsend]
 - Tables: fixed assertion related to inconsistent outer clipping when sizes are not rounded. (#7957) [@eclbtownsend]
 - Tables: fixed assertion with tables with borders when clipped by parent. (#6765, #3752, #7428)
 - Tables: fixed assertion with tables with borders when clipped by parent. (#6765, #3752, #7428)
 - Windows: fixed an issue where double-click to collapse could be triggered even while another
 - Windows: fixed an issue where double-click to collapse could be triggered even while another

+ 1 - 1
imgui_tables.cpp

@@ -866,7 +866,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
 
 
         // Calculate ideal/auto column width (that's the width required for all contents to be visible without clipping)
         // Calculate ideal/auto column width (that's the width required for all contents to be visible without clipping)
         // Combine width from regular rows + width from headers unless requested not to.
         // Combine width from regular rows + width from headers unless requested not to.
-        if (!column->IsPreserveWidthAuto)
+        if (!column->IsPreserveWidthAuto && table->InstanceCurrent == 0)
             column->WidthAuto = TableGetColumnWidthAuto(table, column);
             column->WidthAuto = TableGetColumnWidthAuto(table, column);
 
 
         // Non-resizable columns keep their requested width (apply user value regardless of IsPreserveWidthAuto)
         // Non-resizable columns keep their requested width (apply user value regardless of IsPreserveWidthAuto)