This repository was archived by the owner on Oct 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -160,22 +160,28 @@ private void UpdateColumnSizes()
160160 // the star width for the non-constrained columns.
161161 if ( starWidthWasConstrained && MathUtilities . GreaterThan ( availableSpace , 0 ) )
162162 {
163+ var remainingSpace = availableSpace ;
164+ var remainingStars = totalStars ;
165+
163166 for ( var i = 0 ; i < Count ; ++ i )
164167 {
165168 var column = ( IUpdateColumnLayout ) this [ i ] ;
166169
167170 if ( column . StarWidthWasConstrained )
168171 {
169- availableSpace -= column . ActualWidth ;
170- totalStars -= column . Width . Value ;
172+ remainingSpace -= column . ActualWidth ;
173+ remainingStars -= column . Width . Value ;
171174 }
172175 }
173176
174- for ( var i = 0 ; i < Count ; ++ i )
177+ if ( remainingStars > 0 )
175178 {
176- var column = ( IUpdateColumnLayout ) this [ i ] ;
177- if ( column . Width . IsStar && ! column . StarWidthWasConstrained )
178- column . CalculateStarWidth ( availableSpace , totalStars ) ;
179+ for ( var i = 0 ; i < Count ; ++ i )
180+ {
181+ var column = ( IUpdateColumnLayout ) this [ i ] ;
182+ if ( column . Width . IsStar && ! column . StarWidthWasConstrained )
183+ column . CalculateStarWidth ( remainingSpace , remainingStars ) ;
184+ }
179185 }
180186 }
181187
You can’t perform that action at this time.
0 commit comments