Skip to content

Commit bd74717

Browse files
committed
refactor: special position layout
1 parent 24a66e2 commit bd74717

File tree

3 files changed

+335
-500
lines changed

3 files changed

+335
-500
lines changed

float-pigment-layout/src/algo/flex_box.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,11 @@ impl<T: LayoutTreeNode> FlexBox<T> for LayoutUnit<T> {
13441344
&ret,
13451345
border,
13461346
padding_border,
1347-
dir,
1348-
main_dir_rev,
1349-
AxisReverse::NotReversed,
1347+
AxisInfo {
1348+
dir,
1349+
main_dir_rev,
1350+
cross_dir_rev: AxisReverse::NotReversed,
1351+
},
13501352
true,
13511353
);
13521354
self.result = Rect::new(Point::zero(), ret.size.0);

float-pigment-layout/src/algo/flow.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ impl<T: LayoutTreeNode> Flow<T> for LayoutUnit<T> {
297297
&ret,
298298
border,
299299
padding_border,
300-
axis_info.dir,
301-
axis_info.main_dir_rev,
302-
AxisReverse::NotReversed,
300+
AxisInfo {
301+
cross_dir_rev: AxisReverse::NotReversed,
302+
..axis_info
303+
},
303304
false,
304305
);
305306
self.result = Rect::new(Point::zero(), ret.size.0);
@@ -671,9 +672,7 @@ impl<T: LayoutTreeNode> Flow<T> for LayoutUnit<T> {
671672
},
672673
border,
673674
padding_border,
674-
axis_info.dir,
675-
axis_info.main_dir_rev,
676-
axis_info.cross_dir_rev,
675+
axis_info,
677676
false,
678677
)
679678
}

0 commit comments

Comments
 (0)