Fix some comments

This commit is contained in:
Martin Haug 2021-11-24 20:07:44 +01:00
parent 0ad0fa5a05
commit 5677766715
2 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,7 @@ impl Linear {
Self { rel, abs } Self { rel, abs }
} }
/// Resolve this relative to the given `length`. /// Resolve this linear's relative component to the given `length`.
pub fn resolve(self, length: Length) -> Length { pub fn resolve(self, length: Length) -> Length {
self.rel.resolve(length) + self.abs self.rel.resolve(length) + self.abs
} }

View File

@ -190,9 +190,15 @@ impl<'a> GridLayouter<'a> {
/// Determine all column sizes. /// Determine all column sizes.
fn measure_columns(&mut self, ctx: &mut LayoutContext) { fn measure_columns(&mut self, ctx: &mut LayoutContext) {
enum Case { enum Case {
/// The column sizing is only determined by specified linear sizes.
PurelyLinear, PurelyLinear,
/// The column sizing would be affected by the region size if it was
/// smaller.
Fitting, Fitting,
/// The column sizing is affected by the region size.
Exact, Exact,
/// The column sizing would be affected by the region size if it was
/// larger.
Overflowing, Overflowing,
} }
@ -284,7 +290,7 @@ impl<'a> GridLayouter<'a> {
let mut regions = let mut regions =
Regions::one(size, self.regions.base, Spec::splat(false)); Regions::one(size, self.regions.base, Spec::splat(false));
// For fractional rows, we can already resolve the correct // For linear rows, we can already resolve the correct
// base, for auto it's already correct and for fr we could // base, for auto it's already correct and for fr we could
// only guess anyway. // only guess anyway.
if let TrackSizing::Linear(v) = self.rows[y] { if let TrackSizing::Linear(v) = self.rows[y] {