feat: allocate weighted flex space and remeasure affected occurrences
Verify Tessera GUI / verify (push) Failing after 7m59s

This commit is contained in:
2026-10-22 22:01:28 +08:00
parent 0c1cc12b6b
commit 78fb66277d
12 changed files with 202 additions and 18 deletions
+7 -1
View File
@@ -117,6 +117,7 @@ pub struct Data {
pub children: Vec<Child>,
pub padding: f32,
pub gap: f32,
pub flex: f32,
pub main_align: crate::layout::MainAlign,
pub scroll_axis: crate::scroll::Axis,
pub next_slot: u64,
@@ -144,6 +145,7 @@ impl Data {
.collect(),
padding,
gap,
flex: 0.0,
main_align: crate::layout::MainAlign::Start,
scroll_axis: crate::scroll::Axis::Both,
next_slot,
@@ -315,7 +317,7 @@ pub fn native_properties(data: &Data) -> Vec<(&'static str, Value)> {
fn number(value: f32) -> Value {
Value::Number((value as f64).into())
}
let mut fields = vec![];
let mut fields = vec![("flex", number(data.flex))];
match &data.kind {
Kind::Text { value, size, color } => fields.extend([
("text", Value::Text(value.clone())),
@@ -375,6 +377,10 @@ pub fn apply_visual_property(data: &mut Data, name: &str, value: &Value) -> Resu
}
Ok(n)
};
if name == "flex" {
data.flex = number()?;
return Ok(());
}
let container = data.is_container();
if container && name == "mainAlign" {
let Value::Text(value) = value else {