Add axis-aware scroll constraints and per-mount limits
Verify Tessera GUI / verify (push) Failing after 7m38s

This commit is contained in:
2026-10-22 19:35:38 +08:00
parent 2b20976658
commit 1885693f7c
13 changed files with 277 additions and 14 deletions
+13 -3
View File
@@ -117,6 +117,7 @@ pub struct Data {
pub children: Vec<Child>,
pub padding: f32,
pub gap: f32,
pub scroll_axis: crate::scroll::Axis,
pub next_slot: u64,
pub history: Vec<ObjectRef>,
pub history_index: usize,
@@ -142,6 +143,7 @@ impl Data {
.collect(),
padding,
gap,
scroll_axis: crate::scroll::Axis::Both,
next_slot,
history: vec![],
history_index: 0,
@@ -329,9 +331,11 @@ pub fn native_properties(data: &Data) -> Vec<(&'static str, Value)> {
("radius", number(*radius)),
("color", Value::Text(color.clone())),
]),
Kind::Scroll { width, height } => {
fields.extend([("width", number(*width)), ("height", number(*height))])
}
Kind::Scroll { width, height } => fields.extend([
("width", number(*width)),
("height", number(*height)),
("axis", Value::Text(data.scroll_axis.name().into())),
]),
Kind::Spacer(size) => fields.push(("size", number(*size))),
_ => {}
}
@@ -390,6 +394,12 @@ pub fn apply_visual_property(data: &mut Data, name: &str, value: &Value) -> Resu
crate::document::parse_color(value).map_err(|_| bad())?;
color.clone_from(value);
}
(Kind::Scroll { .. }, "axis") => {
let Value::Text(name) = value else {
return Err(bad());
};
data.scroll_axis = crate::scroll::Axis::parse(name)?;
}
(Kind::Scroll { width, .. }, "width") => *width = number()?,
(Kind::Scroll { height, .. }, "height") => *height = number()?,
(Kind::Rect { width, .. }, "width") => *width = number()?,