Remove implicit_size from the Item vtable

Use the preferred size in the layouting_info instead.
This commit is contained in:
Olivier Goffart 2021-05-04 15:33:04 +02:00 committed by Olivier Goffart
parent c6103aa9ce
commit 81473c2541
9 changed files with 31 additions and 159 deletions

View file

@ -43,7 +43,7 @@ pub enum BuiltinFunction {
ColorBrighter,
ColorDarker,
Rgb,
ImplicitItemSize,
ImplicitLayoutInfo,
RegisterCustomFontByPath,
RegisterCustomFontByMemory,
}
@ -97,18 +97,8 @@ impl BuiltinFunction {
BuiltinFunction::StringIsFloat => {
Type::Function { return_type: Box::new(Type::Bool), args: vec![Type::String] }
}
BuiltinFunction::ImplicitItemSize => Type::Function {
return_type: Box::new(Type::Struct {
fields: [
("width".to_string(), Type::LogicalLength),
("height".to_string(), Type::LogicalLength),
]
.iter()
.cloned()
.collect(),
name: Some("Size".to_string()),
node: None,
}),
BuiltinFunction::ImplicitLayoutInfo => Type::Function {
return_type: Box::new(crate::layout::layout_info_type()),
args: vec![Type::ElementReference],
},
BuiltinFunction::ColorBrighter => Type::Function {