mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Add some helpers to resolve percentages of box sizes
This commit is contained in:
parent
48ceb56339
commit
4ebdc39ecd
2 changed files with 90 additions and 95 deletions
|
@ -141,6 +141,15 @@ impl flow_relative::Vec2<Length> {
|
|||
}
|
||||
}
|
||||
|
||||
impl flow_relative::Vec2<LengthOrAuto> {
|
||||
pub fn auto_is(&self, f: impl Fn() -> Length) -> flow_relative::Vec2<Length> {
|
||||
flow_relative::Vec2 {
|
||||
inline: self.inline.auto_is(&f),
|
||||
block: self.block.auto_is(&f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl flow_relative::Rect<Length> {
|
||||
pub fn zero() -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue