File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/Files.App.Controls/AdaptiveGridView Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ private double ItemWidth
152152
153153 private static int CalculateColumns ( double containerWidth , double itemWidth )
154154 {
155- var columns = ( int ) Math . Round ( containerWidth / itemWidth ) ;
155+ var columns = itemWidth > 0 ? ( int ) Math . Round ( containerWidth / itemWidth ) : 0 ;
156156 if ( columns == 0 )
157157 {
158158 columns = 1 ;
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ protected virtual double CalculateItemWidth(double containerWidth)
119119 _needContainerMarginForLayout = true ;
120120 }
121121
122- return ( containerWidth / columns ) - itemMargin . Left - itemMargin . Right ;
122+ return columns > 0 ? ( containerWidth / columns ) - itemMargin . Left - itemMargin . Right : 0 ;
123123 }
124124
125125 /// <summary>
You can’t perform that action at this time.
0 commit comments