Add per-Mount scrolling with shared paint and input clipping
Verify Tessera GUI / verify (push) Failing after 7m33s

This commit is contained in:
2026-10-21 22:05:08 +08:00
parent 7acc5783a5
commit 6e69c5e5ce
18 changed files with 784 additions and 33 deletions
+7
View File
@@ -64,6 +64,9 @@ pub fn root_constraints(viewport: Option<Size>) -> [f32; 4] {
[0.0, 0.0, size.width, size.height]
}
pub fn child_constraints(node: &UiNode, parent: [f32; 4]) -> [f32; 4] {
if matches!(node.kind, UiKind::Scroll { .. }) {
return [0.0, 0.0, MAX_DIMENSION as f32, MAX_DIMENSION as f32];
}
match container(node) {
Some((true, padding, _)) => [
0.0,
@@ -90,6 +93,7 @@ pub fn constrained(size: Size, constraints: [f32; 4]) -> Size {
fn container(node: &UiNode) -> Option<(bool, f32, f32)> {
match &node.kind {
UiKind::Row { padding, gap, .. } => Some((true, *padding, *gap)),
UiKind::Scroll { padding, gap, .. } => Some((false, *padding, *gap)),
UiKind::Column { padding, gap, .. } | UiKind::Button { padding, gap, .. } => {
Some((false, *padding, *gap))
}
@@ -145,6 +149,7 @@ fn shape(node: &UiNode, children: Vec<Size>) -> Result<Shape> {
UiKind::Text { value, size, .. } => Shape::Text(value.clone(), *size),
UiKind::Rect { width, height, .. } => Shape::Rect(*width, *height),
UiKind::Spacer(size) => Shape::Rect(*size, *size),
UiKind::Scroll { width, height, .. } => Shape::Rect(*width, *height),
_ => {
let (row, padding, gap) = container(node).context("unknown native visual protocol")?;
Shape::Container(row, padding, gap, children)
@@ -345,6 +350,8 @@ impl LayoutRuntime {
bounded(y + size.height)?;
mounts.push(MountGeometry {
id: item.id,
clip: None,
scroll: None,
block_id: item.node.block_id.clone(),
parent: item.parent.map(|i| items[i].id),
first_child: item.children.first().map(|i| items[*i].id),