mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Prepare for use of percentages as widths in layouts
Delay the conversion of percentage to the float to code generation type by inserting the multiplication into the syntax tree. That way we will be able to detect plain uses of percetages and interpret them differently.
This commit is contained in:
parent
72b1f0259b
commit
071ab9fda1
5 changed files with 17 additions and 3 deletions
|
@ -146,7 +146,7 @@ fn to_eval_value<'cx>(
|
|||
) -> NeonResult<sixtyfps_interpreter::Value> {
|
||||
use sixtyfps_interpreter::Value;
|
||||
match ty {
|
||||
Type::Float32 | Type::Int32 | Type::Duration | Type::Length | Type::LogicalLength => {
|
||||
Type::Float32 | Type::Int32 | Type::Duration | Type::Length | Type::LogicalLength | Type::Percent => {
|
||||
Ok(Value::Number(val.downcast_or_throw::<JsNumber, _>(cx)?.value()))
|
||||
}
|
||||
Type::String => Ok(Value::String(val.to_string(cx)?.value().into())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue