improved documentation and refactored naming to be more self-explanatory
This commit is contained in:
1 parent
e4d60c8dfc
commit
adfbb6c380
91 files changed
+1663
-1553
No files matched your search
@@ -340,26 +340,27 @@ pub fn apply_layout_attributes_cfg(
|
||||
}
|
||||
Property::JustifyContent(justify, _) => {
|
||||
use AlignContent::*;
|
||||
style.justify_content = match justify {
|
||||
align::JustifyContent::ContentDistribution(distribution) => {
|
||||
match distribution {
|
||||
align::ContentDistribution::SpaceBetween => Some(SpaceBetween),
|
||||
align::ContentDistribution::SpaceAround => Some(SpaceAround),
|
||||
align::ContentDistribution::SpaceEvenly => Some(SpaceEvenly),
|
||||
_ => return,
|
||||
style.justify_content =
|
||||
match justify {
|
||||
align::JustifyContent::ContentDistribution(distribution) => {
|
||||
match distribution {
|
||||
align::ContentDistribution::SpaceBetween => Some(SpaceBetween),
|
||||
align::ContentDistribution::SpaceAround => Some(SpaceAround),
|
||||
align::ContentDistribution::SpaceEvenly => Some(SpaceEvenly),
|
||||
_ => return,
|
||||
}
|
||||
}
|
||||
}
|
||||
align::JustifyContent::ContentPosition {
|
||||
value: position, ..
|
||||
} => match position {
|
||||
align::ContentPosition::Center => Some(Center),
|
||||
align::ContentPosition::Start => Some(Start),
|
||||
align::ContentPosition::FlexStart => Some(FlexStart),
|
||||
align::ContentPosition::End => Some(End),
|
||||
align::ContentPosition::FlexEnd => Some(FlexEnd),
|
||||
},
|
||||
_ => return,
|
||||
};
|
||||
align::JustifyContent::ContentPosition {
|
||||
value: position, ..
|
||||
} => match position {
|
||||
align::ContentPosition::Center => Some(Center),
|
||||
align::ContentPosition::Start => Some(Start),
|
||||
align::ContentPosition::FlexStart => Some(FlexStart),
|
||||
align::ContentPosition::End => Some(End),
|
||||
align::ContentPosition::FlexEnd => Some(FlexEnd),
|
||||
},
|
||||
_ => return,
|
||||
};
|
||||
}
|
||||
Property::AlignSelf(align, _) => {
|
||||
use AlignItems::*;
|
||||
@@ -585,11 +586,13 @@ fn convert_grid_track_size(input: grid::TrackSize) -> NonRepeatedTrackSizingFunc
|
||||
convert_track_breadth_min(&min),
|
||||
convert_track_breadth_max(&max),
|
||||
),
|
||||
grid::TrackSize::FitContent(limit) => match limit {
|
||||
DimensionPercentage::Dimension(LengthValue::Px(len)) => minmax(auto(), points(len)),
|
||||
DimensionPercentage::Percentage(Percentage(pct)) => minmax(auto(), percent(pct)),
|
||||
_ => unimplemented!(),
|
||||
},
|
||||
grid::TrackSize::FitContent(limit) => {
|
||||
match limit {
|
||||
DimensionPercentage::Dimension(LengthValue::Px(len)) => minmax(auto(), points(len)),
|
||||
DimensionPercentage::Percentage(Percentage(pct)) => minmax(auto(), percent(pct)),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -488,8 +488,5 @@ fn persist_instertions_after() {
|
||||
));
|
||||
let text = "hello world".to_string();
|
||||
let idx = iter.next(&rdom).id();
|
||||
assert!(matches!(
|
||||
&*rdom.get(idx).unwrap().node_type(),
|
||||
NodeType::Text(text)
|
||||
));
|
||||
assert!(matches!(&*rdom.get(idx).unwrap().node_type(), NodeType::Text(text)));
|
||||
}
|
||||
Reference in new issue
Block a user