@@ -72,7 +72,7 @@ internal override int Calculate (int location, int superviewContentSize, View us
72
72
{
73
73
maxCalculatedSize = textSize ;
74
74
75
- if ( us is { ContentSizeTracksViewport : false , InternalSubviews . Count : 0 } )
75
+ if ( us is { ContentSizeTracksViewport : false , InternalSubViews . Count : 0 } )
76
76
{
77
77
// ContentSize was explicitly set. Use `us.ContentSize` to determine size.
78
78
maxCalculatedSize = dimension == Dimension . Width ? us . GetContentSize ( ) . Width : us . GetContentSize ( ) . Height ;
@@ -81,12 +81,12 @@ internal override int Calculate (int location, int superviewContentSize, View us
81
81
{
82
82
// TOOD: All the below is a naive implementation. It may be possible to optimize this.
83
83
84
- List < View > includedSubviews = us . InternalSubviews . ToList ( ) ;
84
+ List < View > includedSubViews = us . InternalSubViews . ToList ( ) ;
85
85
86
86
// If [x] it can cause `us.ContentSize` to change.
87
87
// If [ ] it doesn't need special processing for us to determine `us.ContentSize`.
88
88
89
- // -------------------- Pos types that are dependent on `us.Subviews `
89
+ // -------------------- Pos types that are dependent on `us.SubViews `
90
90
// [ ] PosAlign - Position is dependent on other views with `GroupId` AND `us.ContentSize`
91
91
// [x] PosView - Position is dependent on `subview.Target` - it can cause a change in `us.ContentSize`
92
92
// [x] PosCombine - Position is dependent if `Pos.Has [one of the above]` - it can cause a change in `us.ContentSize`
@@ -98,11 +98,11 @@ internal override int Calculate (int location, int superviewContentSize, View us
98
98
// [ ] PosPercent - Position is dependent `us.ContentSize` - Will always be 0 if there is no other content that makes the superview have a size.
99
99
// [x] PosCombine - Position is dependent if `Pos.Has [one of the above]` - it can cause a change in `us.ContentSize`
100
100
101
- // -------------------- Pos types that are not dependent on either `us.Subviews ` or `us.ContentSize`
101
+ // -------------------- Pos types that are not dependent on either `us.SubViews ` or `us.ContentSize`
102
102
// [ ] PosAbsolute - Position is fixed.
103
103
// [ ] PosFunc - Position is internally calculated.
104
104
105
- // -------------------- Dim types that are dependent on `us.Subviews `
105
+ // -------------------- Dim types that are dependent on `us.SubViews `
106
106
// [x] DimView - Dimension is dependent on `subview.Target`
107
107
// [x] DimCombine - Dimension is dependent if `Dim.Has [one of the above]` - it can cause a change in `us.ContentSize`
108
108
@@ -111,7 +111,7 @@ internal override int Calculate (int location, int superviewContentSize, View us
111
111
// [ ] DimPercent - Dimension is dependent on `us.ContentSize` - Will always be 0 if there is no other content that makes the superview have a size.
112
112
// [ ] DimCombine - Dimension is dependent if `Dim.Has [one of the above]`
113
113
114
- // -------------------- Dim types that are not dependent on either `us.Subviews ` or `us.ContentSize`
114
+ // -------------------- Dim types that are not dependent on either `us.SubViews ` or `us.ContentSize`
115
115
// [ ] DimAuto - Dimension is internally calculated
116
116
// [ ] DimAbsolute - Dimension is fixed
117
117
// [ ] DimFunc - Dimension is internally calculated
@@ -128,7 +128,7 @@ internal override int Calculate (int location, int superviewContentSize, View us
128
128
129
129
if ( dimension == Dimension . Width )
130
130
{
131
- notDependentSubViews = includedSubviews . Where (
131
+ notDependentSubViews = includedSubViews . Where (
132
132
v => v . Width is { }
133
133
&& ( v . X is PosAbsolute or PosFunc
134
134
|| v . Width is DimAuto
@@ -144,7 +144,7 @@ or DimAbsolute
144
144
}
145
145
else
146
146
{
147
- notDependentSubViews = includedSubviews . Where (
147
+ notDependentSubViews = includedSubViews . Where (
148
148
v => v . Height is { }
149
149
&& ( v . Y is PosAbsolute or PosFunc
150
150
|| v . Height is DimAuto
@@ -197,11 +197,11 @@ or DimAbsolute
197
197
198
198
if ( dimension == Dimension . Width )
199
199
{
200
- centeredSubViews = us . InternalSubviews . Where ( v => v . X . Has < PosCenter > ( out _ ) ) . ToList ( ) ;
200
+ centeredSubViews = us . InternalSubViews . Where ( v => v . X . Has < PosCenter > ( out _ ) ) . ToList ( ) ;
201
201
}
202
202
else
203
203
{
204
- centeredSubViews = us . InternalSubviews . Where ( v => v . Y . Has < PosCenter > ( out _ ) ) . ToList ( ) ;
204
+ centeredSubViews = us . InternalSubViews . Where ( v => v . Y . Has < PosCenter > ( out _ ) ) . ToList ( ) ;
205
205
}
206
206
207
207
viewsNeedingLayout . AddRange ( centeredSubViews ) ;
@@ -241,7 +241,7 @@ or DimAbsolute
241
241
var maxAlign = 0 ;
242
242
243
243
// Use Linq to get a list of distinct GroupIds from the subviews
244
- List < int > groupIds = includedSubviews . Select (
244
+ List < int > groupIds = includedSubViews . Select (
245
245
v =>
246
246
{
247
247
return dimension switch
@@ -259,7 +259,7 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
259
259
foreach ( int groupId in groupIds . Where ( g => g != - 1 ) )
260
260
{
261
261
// PERF: If this proves a perf issue, consider caching a ref to this list in each item
262
- List < PosAlign ? > posAlignsInGroup = includedSubviews . Where ( v => PosAlign . HasGroupId ( v , dimension , groupId ) )
262
+ List < PosAlign ? > posAlignsInGroup = includedSubViews . Where ( v => PosAlign . HasGroupId ( v , dimension , groupId ) )
263
263
. Select ( v => dimension == Dimension . Width ? v . X as PosAlign : v . Y as PosAlign )
264
264
. ToList ( ) ;
265
265
@@ -268,7 +268,7 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
268
268
continue ;
269
269
}
270
270
271
- maxAlign = PosAlign . CalculateMinDimension ( groupId , includedSubviews , dimension ) ;
271
+ maxAlign = PosAlign . CalculateMinDimension ( groupId , includedSubViews , dimension ) ;
272
272
}
273
273
274
274
maxCalculatedSize = int . Max ( maxCalculatedSize , maxAlign ) ;
@@ -282,11 +282,11 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
282
282
283
283
if ( dimension == Dimension . Width )
284
284
{
285
- anchoredSubViews = includedSubviews . Where ( v => v . X . Has < PosAnchorEnd > ( out _ ) ) . ToList ( ) ;
285
+ anchoredSubViews = includedSubViews . Where ( v => v . X . Has < PosAnchorEnd > ( out _ ) ) . ToList ( ) ;
286
286
}
287
287
else
288
288
{
289
- anchoredSubViews = includedSubviews . Where ( v => v . Y . Has < PosAnchorEnd > ( out _ ) ) . ToList ( ) ;
289
+ anchoredSubViews = includedSubViews . Where ( v => v . Y . Has < PosAnchorEnd > ( out _ ) ) . ToList ( ) ;
290
290
}
291
291
292
292
viewsNeedingLayout . AddRange ( anchoredSubViews ) ;
@@ -324,11 +324,11 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
324
324
325
325
if ( dimension == Dimension . Width )
326
326
{
327
- posViewSubViews = includedSubviews . Where ( v => v . X . Has < PosView > ( out _ ) ) . ToList ( ) ;
327
+ posViewSubViews = includedSubViews . Where ( v => v . X . Has < PosView > ( out _ ) ) . ToList ( ) ;
328
328
}
329
329
else
330
330
{
331
- posViewSubViews = includedSubviews . Where ( v => v . Y . Has < PosView > ( out _ ) ) . ToList ( ) ;
331
+ posViewSubViews = includedSubViews . Where ( v => v . Y . Has < PosView > ( out _ ) ) . ToList ( ) ;
332
332
}
333
333
334
334
for ( var i = 0 ; i < posViewSubViews . Count ; i ++ )
@@ -358,11 +358,11 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
358
358
359
359
if ( dimension == Dimension . Width )
360
360
{
361
- dimViewSubViews = includedSubviews . Where ( v => v . Width is { } && v . Width . Has < DimView > ( out _ ) ) . ToList ( ) ;
361
+ dimViewSubViews = includedSubViews . Where ( v => v . Width is { } && v . Width . Has < DimView > ( out _ ) ) . ToList ( ) ;
362
362
}
363
363
else
364
364
{
365
- dimViewSubViews = includedSubviews . Where ( v => v . Height is { } && v . Height . Has < DimView > ( out _ ) ) . ToList ( ) ;
365
+ dimViewSubViews = includedSubViews . Where ( v => v . Height is { } && v . Height . Has < DimView > ( out _ ) ) . ToList ( ) ;
366
366
}
367
367
368
368
for ( var i = 0 ; i < dimViewSubViews . Count ; i ++ )
@@ -391,11 +391,11 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
391
391
392
392
if ( dimension == Dimension . Width )
393
393
{
394
- dimAutoSubViews = includedSubviews . Where ( v => v . Width is { } && v . Width . Has < DimAuto > ( out _ ) ) . ToList ( ) ;
394
+ dimAutoSubViews = includedSubViews . Where ( v => v . Width is { } && v . Width . Has < DimAuto > ( out _ ) ) . ToList ( ) ;
395
395
}
396
396
else
397
397
{
398
- dimAutoSubViews = includedSubviews . Where ( v => v . Height is { } && v . Height . Has < DimAuto > ( out _ ) ) . ToList ( ) ;
398
+ dimAutoSubViews = includedSubViews . Where ( v => v . Height is { } && v . Height . Has < DimAuto > ( out _ ) ) . ToList ( ) ;
399
399
}
400
400
401
401
for ( var i = 0 ; i < dimAutoSubViews . Count ; i ++ )
@@ -423,11 +423,11 @@ Dimension.Height when v.Y.Has<PosAlign> (out PosAlign posAlign) =>
423
423
424
424
//if (dimension == Dimension.Width)
425
425
//{
426
- // DimFillSubViews = includedSubviews .Where (v => v.Width is { } && v.Width.Has<DimFill> (out _)).ToList ();
426
+ // DimFillSubViews = includedSubViews .Where (v => v.Width is { } && v.Width.Has<DimFill> (out _)).ToList ();
427
427
//}
428
428
//else
429
429
//{
430
- // DimFillSubViews = includedSubviews .Where (v => v.Height is { } && v.Height.Has<DimFill> (out _)).ToList ();
430
+ // DimFillSubViews = includedSubViews .Where (v => v.Height is { } && v.Height.Has<DimFill> (out _)).ToList ();
431
431
//}
432
432
433
433
//for (var i = 0; i < DimFillSubViews.Count; i++)
0 commit comments