File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Microsoft.Toolkit.Uwp.UI.Controls/WrapPanel Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -66,15 +66,15 @@ public Rect ToRect(Orientation orientation)
66
66
}
67
67
}
68
68
69
- private class Row
69
+ private struct Row
70
70
{
71
71
private readonly List < UvRect > _childrenRects ;
72
72
private UvMeasure _rowSize ;
73
73
74
- public Row ( )
74
+ public Row ( List < UvRect > childrenRects , UvMeasure size )
75
75
{
76
- _childrenRects = new List < UvRect > ( ) ;
77
- _rowSize = UvMeasure . Zero ;
76
+ _childrenRects = childrenRects ;
77
+ _rowSize = size ;
78
78
}
79
79
80
80
public IReadOnlyList < UvRect > ChildrenRects => _childrenRects ;
@@ -87,7 +87,7 @@ public Row()
87
87
public void Add ( UvMeasure position , UvMeasure size )
88
88
{
89
89
_childrenRects . Add ( new UvRect { Position = position , Size = size } ) ;
90
- _rowSize . U = Math . Max ( _rowSize . U , position . U + size . U ) ;
90
+ _rowSize . U = position . U + size . U ;
91
91
_rowSize . V = Math . Max ( _rowSize . V , size . V ) ;
92
92
}
93
93
}
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ protected override Size ArrangeOverride(Size finalSize)
209
209
var paddingEnd = new UvMeasure ( Orientation , Padding . Right , Padding . Bottom ) ;
210
210
var position = new UvMeasure ( Orientation , Padding . Left , Padding . Top ) ;
211
211
212
- var currentRow = new Row ( ) ;
212
+ var currentRow = new Row ( new List < UvRect > ( ) , default ) ;
213
213
void Arrange ( UIElement child , bool isLast = false )
214
214
{
215
215
var desiredMeasure = new UvMeasure ( Orientation , child . DesiredSize ) ;
@@ -225,7 +225,7 @@ void Arrange(UIElement child, bool isLast = false)
225
225
position . V += currentRow . Size . V + spacingMeasure . V ;
226
226
227
227
rows . Add ( currentRow ) ;
228
- currentRow = new Row ( ) ;
228
+ currentRow = new Row ( new List < UvRect > ( ) , default ) ;
229
229
}
230
230
231
231
// Stretch the last item to fill the available space
You can’t perform that action at this time.
0 commit comments