Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
FC0a: ui/scroll_and_overflow/scrollbars passes (SSIM 0.9945, worst tile 21), with bevy_ui's ScrollPosition and IgnoreScroll, bevy_ui_widgets' Scrollbar and ScrollbarThumb, and UiScale laid out at its scale.
shinyobjectzec33f6b871b2
diff --git a/bench/bevy-parity/examples.list b/bench/bevy-parity/examples.listindex 799bf1e7..606cac6b 100644--- a/bench/bevy-parity/examples.list+++ b/bench/bevy-parity/examples.list@@ -85,3 +85,4 @@ ui/text/text_debugui/ui_transformui/scroll_and_overflow/scrollui/scroll_and_overflow/drag_to_scroll+ui/scroll_and_overflow/scrollbarsdiff --git a/bench/bevy-parity/runs.tsv b/bench/bevy-parity/runs.tsvindex 606d73ae..38cf34ba 100644--- a/bench/bevy-parity/runs.tsv+++ b/bench/bevy-parity/runs.tsv@@ -84,3 +84,4 @@ ui/text/text_debug - 10ui/ui_transform - 10ui/scroll_and_overflow/scroll - 10ui/scroll_and_overflow/drag_to_scroll - 10+ui/scroll_and_overflow/scrollbars - 10diff --git a/docs/bevy-parity.md b/docs/bevy-parity.mdindex 7986d4b0..f3498aa0 100644--- a/docs/bevy-parity.md+++ b/docs/bevy-parity.md@@ -4,7 +4,7 @@ Bevy v0.20.0's examples against their raea TSX ports (docs/control.feature FC0a)don't edit. An example passes when every probed frame passes pixels (SSIM 0.98 and no 32 px tile off by more than 24 of 255) and cost (batch keys andframe time at most 1.25x the example's). Wall time is one machine's, measured in the same run.-Examples: **438**, ported **85**, passing **81**, excluded **16** (docs/bevy-parity/excluded.tsv), left **341**.+Examples: **438**, ported **86**, passing **82**, excluded **16** (docs/bevy-parity/excluded.tsv), left **340**.raea's frame ms is its update's plus the time React takes to step a frame for its 3D (step), which the exampledoesn't pay.@@ -115,9 +115,6 @@ doesn't pay.| 2d/mesh2d_repeated_texture | 10 | 0.991205 | 17 | 0 / 0 | 437 / 496 | 8 / 10 | 1 / 1 | 26.298 / 1.893 = 1.62 + 0.273 | yes | || ui/layout/flex_layout | 10 | 0.992327 | 8 | 0 / 0 | 602 / 492 | 5 / 7 | 1 / 1 | 35.062 / 1.343 = 1.252 + 0.091 | yes | || ui/scroll_and_overflow/overflow_clip_margin | 10 | 0.997488 | 7 | 0 / 0 | 465 / 492 | 5 / 7 | 1 / 1 | 32.281 / 1.412 = 1.203 + 0.209 | yes | |-| ui/images/ui_texture_slice | 10 | 0.998941 | 8 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 43.512 / 1.125 = 0.98 + 0.145 | yes | |-| ui/images/ui_texture_slice_flip_and_tile | 10 | 1.000000 | 0 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 32.465 / 1.228 = 1.046 + 0.182 | yes | |-| ui/images/ui_texture_atlas_slice | 10 | 0.990813 | 16 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 31.944 / 1.192 = 1.065 + 0.127 | yes | || ui/widgets/button | 10 | 0.999633 | 8 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 33.01 / 1.219 = 1.046 + 0.173 | yes | || ui/text/letter_spacing | 10 | 0.996458 | 13 | 0 / 0 | 455 / 492 | 5 / 7 | 1 / 1 | 33.285 / 1.088 = 0.961 + 0.127 | yes | || ui/styling/borders | 10 | 0.992828 | 9 | 0 / 0 | 591 / 492 | 5 / 7 | 1 / 1 | 33.521 / 1.111 = 1.02 + 0.091 | yes | |@@ -130,9 +127,7 @@ doesn't pay.| ui/layout/ghost_nodes | 10 | 0.998544 | 9 | 0 / 0 | 455 / 492 | 5 / 7 | 1 / 1 | 35.333 / 1.312 = 1.13 + 0.182 | yes | || ui/relative_cursor_position | 10 | 0.999907 | 2 | 0 / 0 | 443 / 492 | 5 / 7 | 1 / 1 | 52.279 / 3.978 = 3.723 + 0.255 | yes | || ui/ui_target_camera | 10 | 0.998769 | 7 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 39.413 / 1.71 = 1.71 + 0 | yes | |-| ui/text/text_wrap_debug | 10 | 0.986254 | 15 | 0 / 0 | 589 / 492 | 5 / 7 | 1 / 1 | 32.74 / 1.068 = 1.068 + 0 | yes | || ui/layout/grid | 10 | 0.995059 | 14 | 0 / 0 | 482 / 492 | 5 / 7 | 1 / 1 | 34.457 / 1.496 = 1.496 + 0 | yes | |-| ui/ui_scaling | 10 | 0.999856 | 5 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 37.383 / 2.14 = 2.14 + 0 | yes | || ui/layout/anchor_layout | 10 | 0.997421 | 9 | 0 / 0 | 468 / 492 | 5 / 7 | 1 / 1 | 33.145 / 1.417 = 1.417 + 0 | yes | || ui/layout/size_constraints | 10 | 0.991466 | 19 | 0 / 0 | 608 / 492 | 5 / 7 | 1 / 1 | 31.358 / 0.993 = 0.993 + 0 | yes | || ui/scroll_and_overflow/overflow_transform | 10 | 0.995397 | 12 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 41.134 / 1.724 = 1.724 + 0 | yes | |@@ -140,7 +135,13 @@ doesn't pay.| ui/text/text_debug | 10 | 0.984022 | 18 | 0 / 0 | 458 / 492 | 5 / 7 | 1 / 1 | 35.188 / 1.093 = 1.093 + 0 | yes | || ui/ui_transform | 10 | 0.999095 | 6 | 0 / 0 | 463 / 492 | 5 / 7 | 1 / 1 | 36.534 / 1.372 = 1.372 + 0 | yes | || ui/scroll_and_overflow/scroll | 10 | 0.997196 | 14 | 0 / 0 | 1988 / 492 | 5 / 7 | 1 / 1 | 35.528 / 1.129 = 1.129 + 0 | yes | |-| ui/scroll_and_overflow/drag_to_scroll | 10 | 0.999993 | 1 | 0 / 0 | 7644 / 492 | 5 / 7 | 1 / 1 | 33.654 / 1.161 = 1.161 + 0 | yes | |+| ui/scroll_and_overflow/drag_to_scroll | 10 | 0.999993 | 1 | 0 / 0 | 7644 / 492 | 5 / 7 | 1 / 1 | 35.892 / 1.362 = 1.362 + 0 | yes | |+| ui/text/text_wrap_debug | 10 | 0.986254 | 15 | 0 / 0 | 589 / 492 | 5 / 7 | 1 / 1 | 33.656 / 1.328 = 1.328 + 0 | yes | |+| ui/ui_scaling | 10 | 0.999856 | 5 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 35.618 / 1.41 = 1.41 + 0 | yes | |+| ui/images/ui_texture_slice_flip_and_tile | 10 | 1.000000 | 0 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 36.761 / 1.341 = 1.341 + 0 | yes | |+| ui/images/ui_texture_slice | 10 | 0.998941 | 8 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 33.914 / 0.905 = 0.905 + 0 | yes | |+| ui/images/ui_texture_atlas_slice | 10 | 0.990813 | 16 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 36.454 / 1.397 = 1.397 + 0 | yes | |+| ui/scroll_and_overflow/scrollbars | 10 | 0.994524 | 21 | 0 / 0 | 462 / 492 | 5 / 7 | 1 / 1 | 43.63 / 1.382 = 1.382 + 0 | yes | |## Excludeddiff --git a/docs/bevy-parity/results.jsonl b/docs/bevy-parity/results.jsonlindex efa36677..320127d3 100644--- a/docs/bevy-parity/results.jsonl+++ b/docs/bevy-parity/results.jsonl@@ -102,9 +102,6 @@{"example":"2d/mesh2d_repeated_texture","frame":10,"ssim":0.991205,"tile":17,"bevy":{"batch_keys":0,"entities":437,"extents":[],"frame":10,"frame_ms":26.298,"materials":1,"mesh_entities":0,"meshes":8,"other_material":0,"visible":0},"raea":{"frame":17,"entities":496,"mesh_entities":0,"visible":0,"meshes":10,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.62,"step_ms":0.273,"cost_ms":1.893},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/flex_layout","frame":10,"ssim":0.992327,"tile":8,"bevy":{"batch_keys":0,"entities":602,"extents":[],"frame":10,"frame_ms":35.062,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.252,"step_ms":0.091,"cost_ms":1.343},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/scroll_and_overflow/overflow_clip_margin","frame":10,"ssim":0.997488,"tile":7,"bevy":{"batch_keys":0,"entities":465,"extents":[],"frame":10,"frame_ms":32.281,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.203,"step_ms":0.209,"cost_ms":1.412},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/ui_texture_slice","frame":10,"ssim":0.998941,"tile":8,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":43.512,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.98,"step_ms":0.145,"cost_ms":1.125},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/ui_texture_slice_flip_and_tile","frame":10,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":10,"frame_ms":32.465,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.046,"step_ms":0.182,"cost_ms":1.228},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/ui_texture_atlas_slice","frame":10,"ssim":0.990813,"tile":16,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":31.944,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.065,"step_ms":0.127,"cost_ms":1.192},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/widgets/button","frame":10,"ssim":0.999633,"tile":8,"bevy":{"batch_keys":0,"entities":444,"extents":[],"frame":10,"frame_ms":33.01,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.046,"step_ms":0.173,"cost_ms":1.219},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/letter_spacing","frame":10,"ssim":0.996458,"tile":13,"bevy":{"batch_keys":0,"entities":455,"extents":[],"frame":10,"frame_ms":33.285,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.961,"step_ms":0.127,"cost_ms":1.088},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/styling/borders","frame":10,"ssim":0.992828,"tile":9,"bevy":{"batch_keys":0,"entities":591,"extents":[],"frame":10,"frame_ms":33.521,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.02,"step_ms":0.091,"cost_ms":1.111},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}@@ -117,9 +114,7 @@{"example":"ui/layout/ghost_nodes","frame":10,"ssim":0.998544,"tile":9,"bevy":{"batch_keys":0,"entities":455,"extents":[],"frame":10,"frame_ms":35.333,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.13,"step_ms":0.182,"cost_ms":1.312},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/relative_cursor_position","frame":10,"ssim":0.999907,"tile":2,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":10,"frame_ms":52.279,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":3.723,"step_ms":0.255,"cost_ms":3.978},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/ui_target_camera","frame":10,"ssim":0.998769,"tile":7,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":10,"frame_ms":39.413,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.71,"step_ms":null,"cost_ms":1.71},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/text/text_wrap_debug","frame":10,"ssim":0.986254,"tile":15,"bevy":{"batch_keys":0,"entities":589,"extents":[],"frame":10,"frame_ms":32.74,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.068,"step_ms":null,"cost_ms":1.068},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/grid","frame":10,"ssim":0.995059,"tile":14,"bevy":{"batch_keys":0,"entities":482,"extents":[],"frame":10,"frame_ms":34.457,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.496,"step_ms":null,"cost_ms":1.496},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/ui_scaling","frame":10,"ssim":0.999856,"tile":5,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":37.383,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.14,"step_ms":null,"cost_ms":2.14},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/anchor_layout","frame":10,"ssim":0.997421,"tile":9,"bevy":{"batch_keys":0,"entities":468,"extents":[],"frame":10,"frame_ms":33.145,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.417,"step_ms":null,"cost_ms":1.417},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/size_constraints","frame":10,"ssim":0.991466,"tile":19,"bevy":{"batch_keys":0,"entities":608,"extents":[],"frame":10,"frame_ms":31.358,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.993,"step_ms":null,"cost_ms":0.993},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/scroll_and_overflow/overflow_transform","frame":10,"ssim":0.995397,"tile":12,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":41.134,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.724,"step_ms":null,"cost_ms":1.724},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}@@ -127,4 +122,10 @@{"example":"ui/text/text_debug","frame":10,"ssim":0.984022,"tile":18,"bevy":{"batch_keys":0,"entities":458,"extents":[],"frame":10,"frame_ms":35.188,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.093,"step_ms":null,"cost_ms":1.093},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/ui_transform","frame":10,"ssim":0.999095,"tile":6,"bevy":{"batch_keys":0,"entities":463,"extents":[],"frame":10,"frame_ms":36.534,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.372,"step_ms":null,"cost_ms":1.372},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/scroll_and_overflow/scroll","frame":10,"ssim":0.997196,"tile":14,"bevy":{"batch_keys":0,"entities":1988,"extents":[],"frame":10,"frame_ms":35.528,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.129,"step_ms":null,"cost_ms":1.129},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/scroll_and_overflow/drag_to_scroll","frame":10,"ssim":0.999993,"tile":1,"bevy":{"batch_keys":0,"entities":7644,"extents":[],"frame":10,"frame_ms":33.654,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.161,"step_ms":null,"cost_ms":1.161},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/scroll_and_overflow/drag_to_scroll","frame":10,"ssim":0.999993,"tile":1,"bevy":{"batch_keys":0,"entities":7644,"extents":[],"frame":10,"frame_ms":35.892,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.362,"step_ms":null,"cost_ms":1.362},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/text/text_wrap_debug","frame":10,"ssim":0.986254,"tile":15,"bevy":{"batch_keys":0,"entities":589,"extents":[],"frame":10,"frame_ms":33.656,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.328,"step_ms":null,"cost_ms":1.328},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/ui_scaling","frame":10,"ssim":0.999856,"tile":5,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":35.618,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.41,"step_ms":null,"cost_ms":1.41},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/ui_texture_slice_flip_and_tile","frame":10,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":10,"frame_ms":36.761,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.341,"step_ms":null,"cost_ms":1.341},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/ui_texture_slice","frame":10,"ssim":0.998941,"tile":8,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":33.914,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.905,"step_ms":null,"cost_ms":0.905},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/ui_texture_atlas_slice","frame":10,"ssim":0.990813,"tile":16,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":36.454,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.397,"step_ms":null,"cost_ms":1.397},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/scroll_and_overflow/scrollbars","frame":10,"ssim":0.994524,"tile":21,"bevy":{"batch_keys":0,"entities":462,"extents":[],"frame":10,"frame_ms":43.63,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.382,"step_ms":null,"cost_ms":1.382},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}diff --git a/runtime/page/src/elements.rs b/runtime/page/src/elements.rsindex ea9de09b..fec26fd7 100644--- a/runtime/page/src/elements.rs+++ b/runtime/page/src/elements.rs@@ -217,9 +217,11 @@ pub(crate) fn page_props(kind: &str, props: Option<&Map<String, Value>>, dir: &P// a sliced ImageNode's data-raea-bevy-slice kept: Blitz scales and tiles its border-image as bevy_ui does,// vendor/blitz-paint render/border_image.rs; a GlobalZIndex node's data-raea-bevy-global-z kept: Blitz ranks it in the// root's stacking context, vendor/blitz-dom layout/paint_tree.rs; a bevy_ui root's data-raea-blend kept: its page- // blends in linear light, systems/page paint;+ // blends in linear light, systems/page paint; a bevy_ui scroller's data-raea-bevy-scroll and an IgnoreScroll node's+ // data-raea-bevy-ignore-scroll kept: Blitz floors its offset and keeps the node in place, vendor/blitz-dom resolve.rs;// the source stamps data-raea-loc and data-raea-use kept for the render manifest, engine/bundle stamp.rs)- if k == "children" || k == "key" || (k.starts_with("data-raea") && k != "data-raea-start" && k != "data-raea-bevy-text" && k != "data-raea-bevy-slice" && k != "data-raea-bevy-global-z" && k != "data-raea-blend" && k != "data-raea-loc" && k != "data-raea-use") || k == "data-props" || k == "data-shape" || k == "data-anim" || v.is_null() {+ const KEPT: [&str; 11] = ["data-raea-start", "data-raea-bevy-text", "data-raea-bevy-slice", "data-raea-bevy-global-z", "data-raea-blend", "data-raea-bevy-scroll", "data-raea-bevy-ignore-scroll", "data-raea-bevy-scrollbar", "data-raea-bevy-thumb", "data-raea-loc", "data-raea-use"];+ if k == "children" || k == "key" || (k.starts_with("data-raea") && !KEPT.contains(&k.as_str())) || k == "data-props" || k == "data-shape" || k == "data-anim" || v.is_null() {continue;}if k.starts_with("on") && k.chars().nth(2).is_some_and(|c| c.is_ascii_uppercase()) {diff --git a/sdk/raea/bench/bevy-parity/ui/scroll_and_overflow/scrollbars.tsx b/sdk/raea/bench/bevy-parity/ui/scroll_and_overflow/scrollbars.tsxnew file mode 100644index 00000000..50ce68d8--- /dev/null+++ b/sdk/raea/bench/bevy-parity/ui/scroll_and_overflow/scrollbars.tsx@@ -0,0 +1,39 @@+// Bevy v0.20.0 examples/ui/scroll_and_overflow/scrollbars.rs in raea's TSX: at UiScale 1.25, a 0.1 grey window with+// "Scrolling" over a 200 x 150 grid: a scroll area (grey, 4 px padding, scrolling both ways, ScrollPosition 10 px+// down) of twelve 14 px text rows, an 8 px vertical scrollbar to its right and an 8 px horizontal one below it, 2 px+// apart. Each thumb is grey with a lighter 1 px border and 4 px corners, and turns white only while hovered or+// dragged, so it stays grey. Bevy's Camera2d over the default clear colour is the layered <Canvas3D>. In Bevy's+// default 1280 x 720 window.+import { AbsoluteFill, Composition, registerRoot } from "raea";+import { Canvas3D } from "raea/3d";+import { BorderRadius, GridPlacement, Node, Overflow, RepeatedGridTrack, Scrollbar, ScrollbarThumb, Text, UiRect, UiScale, px } from "raea/ui";+import { Srgba } from "raea/color";++const GRAY1 = new Srgba(0.224, 0.224, 0.243);+const GRAY2 = new Srgba(0.486, 0.486, 0.529);+const GRAY3 = new Srgba(0.71, 0.71, 0.772);+const ROWS = ["Alpha Wolf", "Beta Blocker", "Delta Sleep", "Gamma Ray", "Epsilon Eridani", "Zeta Function", "Lambda Calculus", "Nu Metal", "Pi Day", "Chi Pants", "Psi Powers", "Omega Fatty Acid"];++const thumb = <ScrollbarThumb background_color={GRAY2} border_color={GRAY3} border_radius={BorderRadius.all(px(4))} border={UiRect.all(px(1))} />;++function Shot() {+ return (+ <AbsoluteFill>+ <Canvas3D layered clearColor="rgb(43, 44, 47)" />+ <UiScale value={1.25}>+ <Node display="Flex" flex_direction="Column" position_type="Absolute" left={px(0)} top={px(0)} right={px(0)} bottom={px(0)} padding={UiRect.all(px(3))} row_gap={px(6)} background_color={new Srgba(0.1, 0.1, 0.1)}>+ <Text>Scrolling</Text>+ <Node display="Grid" width={px(200)} height={px(150)} grid_template_columns={[RepeatedGridTrack.flex(1, 1), RepeatedGridTrack.auto(1)]} grid_template_rows={[RepeatedGridTrack.flex(1, 1), RepeatedGridTrack.auto(1)]} row_gap={px(2)} column_gap={px(2)}>+ <Node name="scroll-area" display="Flex" flex_direction="Column" padding={UiRect.all(px(4))} overflow={Overflow.scroll()} background_color={GRAY1} scroll_position={[0, 10]}>+ {ROWS.map((r) => <Text key={r} font_size={{ Px: 14 }}>{r}</Text>)}+ </Node>+ <Scrollbar target="scroll-area" orientation="Vertical" min_thumb_length={8} min_width={px(8)} grid_row={GridPlacement.start(1)} grid_column={GridPlacement.start(2)}>{thumb}</Scrollbar>+ <Scrollbar target="scroll-area" orientation="Horizontal" min_thumb_length={8} min_height={px(8)} grid_row={GridPlacement.start(2)} grid_column={GridPlacement.start(1)}>{thumb}</Scrollbar>+ </Node>+ </Node>+ </UiScale>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);diff --git a/sdk/raea/conformance/ui-scrollbar.test.tsx b/sdk/raea/conformance/ui-scrollbar.test.tsxnew file mode 100644index 00000000..5a1a1eee--- /dev/null+++ b/sdk/raea/conformance/ui-scrollbar.test.tsx@@ -0,0 +1,58 @@+// docs/control.feature FC0a: bevy_ui's ScrollPosition and bevy_ui_widgets' Scrollbar on the page+// (ui/scroll_and_overflow/scrollbars). Blitz sizes and places the thumb after layout (vendor/blitz-dom bevy_scroll.rs).+import { describe, expect, test } from "bun:test";+import { Node, Overflow, Scrollbar, ScrollbarThumb, UiRect, UiScale, px } from "raea/ui";+import { Srgba } from "raea/color";+import { renderFrame } from "../src/test";++const html = (el: React.ReactElement) => renderFrame(el, { frame: 0, width: 320, height: 240, fps: 30, durationInFrames: 30 });++describe("ScrollPosition: a scroller's offset, on its Scroll axes only", () => {+ test("the offset the page asked for, in physical px under a UiScale, rides along for the thumb", () => {+ const out = html(<UiScale value={1.25}><Node overflow={Overflow.scroll()} scroll_position={[3, 10]} /></UiScale>);+ expect(out).toContain('data-raea-bevy-scroll="1 3.75 12.5"');+ expect(out).toMatch(/zoom:1.25/);+ });+ test("an axis that doesn't scroll stays at 0", () => {+ const out = html(<Node overflow={Overflow.scroll_y()} scroll_position={[30, 10]} />);+ expect(out).toContain('data-raea-bevy-scroll="1 30 10"');+ });+ test("is [x, y] in px", () => {+ expect(() => html(<Node overflow={Overflow.scroll()} scroll_position={[0, NaN]} />)).toThrow(/scroll_position is \[x, y\]/);+ });+});++describe("Scrollbar: a track whose thumb shows its target's view", () => {+ const bar = (p: Partial<React.ComponentProps<typeof Scrollbar>> = {}) => (+ <Node>+ <Node name="area" overflow={Overflow.scroll()} />+ <Scrollbar target="area" orientation="Vertical" min_thumb_length={8} min_width={px(8)} {...p}>+ <ScrollbarThumb background_color={new Srgba(0.5, 0.5, 0.5)} border={UiRect.all(px(1))} />+ </Scrollbar>+ </Node>+ );+ test("Name is the target's id; the track names orientation, least thumb length and target", () => {+ const out = html(bar());+ expect(out).toContain('id="area"');+ expect(out).toContain('data-raea-bevy-scrollbar="v 8 area"');+ expect(html(bar({ orientation: "Horizontal", min_thumb_length: 12 }))).toContain('data-raea-bevy-scrollbar="h 12 area"');+ });+ test("the track is laid out as a Node", () => {+ expect(html(bar())).toMatch(/min-width:8px[^>]*data-raea-bevy-scrollbar/);+ });+ test("the thumb is out of the track's layout, with its own colour and border", () => {+ const out = html(bar());+ const thumb = out.match(/<div style="([^"]*)" data-raea-bevy-thumb="1"/);+ expect(thumb).not.toBeNull();+ expect(thumb![1]).toContain("position:absolute");+ expect(thumb![1]).toContain("border-width:1px");+ expect(thumb![1]).toContain("background-color:");+ });+ test("refuses a bad target, orientation or length, and a thumb or bar outside the UI", () => {+ expect(() => html(bar({ target: "two words" }))).toThrow(/target is a Node's name/);+ expect(() => html(bar({ orientation: "Up" as "Vertical" }))).toThrow(/orientation/);+ expect(() => html(bar({ min_thumb_length: -1 }))).toThrow(/min_thumb_length/);+ expect(() => html(<ScrollbarThumb />)).toThrow(/goes inside a Scrollbar/);+ expect(() => html(<Scrollbar target="a" orientation="Vertical" min_thumb_length={0} />)).toThrow(/goes inside a Node/);+ });+});diff --git a/sdk/raea/conformance/ui.test.tsx b/sdk/raea/conformance/ui.test.tsxindex 9914f4aa..e71f7eb6 100644--- a/sdk/raea/conformance/ui.test.tsx+++ b/sdk/raea/conformance/ui.test.tsx@@ -315,9 +315,10 @@ describe("A sliced ImageNode, a sampled picture and UiScale", () => {expect(html(<ImageNode image={{ path: "p.png", sampler: {} }} />)).not.toContain("image-rendering");expect(() => html(<ImageNode image={{ path: "p.png", sampler: { wrap: "repeat" } }} />)).toThrow(/isn't wrapped/);});- test("UiScale lays its roots out in a window 1/value of the frame and scales it up from the top left", () => {+ test("UiScale zooms its UI: laid out at value times every length, in the frame's window", () => {const out = html(<UiScale value={2}><Node width={px(16)} /></UiScale>);- for (const s of ["width:50%", "height:50%", "transform:scale(2)", "transform-origin:0 0"]) expect(out).toContain(s);+ for (const s of ["width:100%", "height:100%", "zoom:2"]) expect(out).toContain(s);+ expect(out).not.toContain("transform:scale");expect(() => html(<UiScale value={0} />)).toThrow(/above 0/);});});diff --git a/sdk/raea/src/ui.ts b/sdk/raea/src/ui.tsindex f32b4d64..96ad2300 100644--- a/sdk/raea/src/ui.ts+++ b/sdk/raea/src/ui.ts@@ -12,3 +12,4 @@ export { GridTrack, RepeatedGridTrack, GridPlacement, type GridTrackRepetition,export { Rot2, Val2, UiTransform, BoxShadow, type ShadowStyle } from "@raea/render/bevy3d";export { FontFeatureTag } from "@raea/render/bevy3d";export type { IgnoreScroll } from "@raea/render/bevy3d";+export { Scrollbar, ScrollbarThumb, type ScrollbarProps, type ScrollbarThumbProps, type ControlOrientation } from "@raea/render/bevy3d";diff --git a/sdk/render/src/bevy3d.tsx b/sdk/render/src/bevy3d.tsxindex 24aca727..da21684e 100644--- a/sdk/render/src/bevy3d.tsx+++ b/sdk/render/src/bevy3d.tsx@@ -36,4 +36,5 @@ export { GridTrack, RepeatedGridTrack, GridPlacement, type GridTrackRepetition,export { Rot2, Val2, UiTransform, BoxShadow, type ShadowStyle } from "./bevy3d/ui-transform";export { FontFeatureTag } from "./bevy3d/ui-features";export type { IgnoreScroll } from "./bevy3d/ui-scroll";+export { Scrollbar, ScrollbarThumb, type ScrollbarProps, type ScrollbarThumbProps, type ControlOrientation } from "./bevy3d/ui-scrollbar";export { FontSource, type GenericFontFamily } from "./bevy3d/ui-font";diff --git a/sdk/render/src/bevy3d/ui-image.tsx b/sdk/render/src/bevy3d/ui-image.tsxindex 47d8f496..1699c306 100644--- a/sdk/render/src/bevy3d/ui-image.tsx+++ b/sdk/render/src/bevy3d/ui-image.tsx@@ -1,7 +1,7 @@// bevy_ui's ImageNode, drawn by the page: a picture in a Node's box, one cell of a sheet (TextureAtlas), or cut in// nine (NodeImageMode::Sliced), each sampled as ImagePlugin's default sampler or its own says.import { Children, createContext, useContext, type CSSProperties, type ReactNode } from "react";-import { InUi, VIEWPORT, boxOf, nodeCss, type NodeProps } from "./ui";+import { InUi, UiScaleCx, VIEWPORT, boxOf, nodeCss, type NodeProps } from "./ui";import { over, px } from "./ui-val";import { LinearRgba, Srgba } from "./colors";import { samplerSpec, type SamplerSpec } from "../3d/materials";@@ -128,13 +128,15 @@ function SlicedNode({ image, color, flip_x, flip_y, children, fixed, texture_atlif (color !== undefined && !(color.red === 1 && color.green === 1 && color.blue === 1 && color.alpha === 1)) throw new TypeError("ImageNode: a sliced picture is untinted here yet (color white)");const max = sl.max_corner_scale ?? 1;if (!(Number.isFinite(max) && max > 0)) throw new RangeError(`ImageNode: max_corner_scale is above 0, got ${max}`);+ // (lengths in the page's px: under a UiScale's zoom, times it, as Bevy scales them by the scale factor)+ const scale = useContext(UiScaleCx);const mode = (m: SliceScaleMode | undefined, which: string) => {if (m === undefined || m === "Stretch") return "s";const v = typeof m === "object" ? m.Tile?.stretch_value : undefined;if (!(typeof v === "number" && Number.isFinite(v) && v > 0)) throw new TypeError(`ImageNode: ${which} is "Stretch" or { Tile: { stretch_value } } (above 0), got ${JSON.stringify(m)}`);- return `t${v}`;+ return `t${v * scale}`;};- const marker = { "data-raea-bevy-slice": `${max} ${mode(sl.sides_scale_mode, "sides_scale_mode")} ${mode(sl.center_scale_mode, "center_scale_mode")}${cellOf}` };+ const marker = { "data-raea-bevy-slice": `${max * scale} ${mode(sl.sides_scale_mode, "sides_scale_mode")} ${mode(sl.center_scale_mode, "center_scale_mode")}${cellOf}` };const ui = useContext(InUi);const n = nodeCss("ImageNode", p, ui?.back);const rendering = RENDERING[useContext(Sampler)];diff --git a/sdk/render/src/bevy3d/ui-scroll.ts b/sdk/render/src/bevy3d/ui-scroll.tsindex dd16227c..c4a09930 100644--- a/sdk/render/src/bevy3d/ui-scroll.ts+++ b/sdk/render/src/bevy3d/ui-scroll.ts@@ -1,20 +1,37 @@// bevy_ui's scrolling as the page's CSS: a Scroll axis draws no scrollbar (bevy_ui draws none; Blitz would draw an-// overlay thumb), Node's scrollbar_width is the gutter taffy reserves beside it, and IgnoreScroll.+// overlay thumb), Node's scrollbar_width is the gutter taffy reserves beside it, ScrollPosition is the scroller's offset+// and IgnoreScroll keeps a node in place while its parent scrolls.import { checkVal, type Overflow, type UiRect, type Val } from "./ui-val";/** bevy_ui's IgnoreScroll: the axes on which a node keeps its place while its parent scrolls (BVec2).* @bevy bevy_ui::IgnoreScroll */export interface IgnoreScroll { x: boolean; y: boolean }+export interface ScrollProps { overflow?: Overflow; padding?: UiRect; scrollbar_width?: number; scroll_position?: [number, number]; ignore_scroll?: IgnoreScroll }+const grow = (v: Val, w: number) => (v.endsWith("px") ? `${parseFloat(v) + w}px` : `calc(${v} + ${w}px)`);-/** A Node's scroll fields into its CSS, after its padding. taffy reserves scrollbar_width as an inset beside a- * scrolling axis (on the right of one scrolling on y, below one scrolling on x), inside the border as padding is. A- * page here is never scrolled (no ScrollPosition yet), so IgnoreScroll keeps every node where it already is. */-export function scrollCss(who: string, p: { overflow?: Overflow; padding?: UiRect; scrollbar_width?: number; ignore_scroll?: IgnoreScroll }, s: Record<string, unknown>) {+/** A Node's scroll fields into its CSS, after its padding, and its element's attributes. taffy reserves+ * scrollbar_width as an inset beside a scrolling axis (on the right of one scrolling on y, below one scrolling on x),+ * inside the border as padding is. ScrollPosition (logical px, times `scale`, the UiScale) scrolls only a Scroll axis;+ * Blitz keeps it in the scroller's range once laid out and floors it to whole physical px, as bevy_ui's layout does (vendor/blitz-dom resolve.rs). IgnoreScroll: Blitz moves the node back by its parent's scroll. */+export function scrollCss(who: string, p: ScrollProps, s: Record<string, unknown>, attrs: Record<string, string | number>, scale = 1) {const o = p.overflow;if (o && (o.x === "Scroll" || o.y === "Scroll")) s.scrollbarWidth = "none";- if (p.ignore_scroll !== undefined && (typeof p.ignore_scroll?.x !== "boolean" || typeof p.ignore_scroll?.y !== "boolean")) throw new TypeError(`${who}: ignore_scroll is { x: boolean, y: boolean }, got ${JSON.stringify(p.ignore_scroll)}`);+ const ig = p.ignore_scroll;+ if (ig !== undefined) {+ if (typeof ig?.x !== "boolean" || typeof ig?.y !== "boolean") throw new TypeError(`${who}: ignore_scroll is { x: boolean, y: boolean }, got ${JSON.stringify(ig)}`);+ if (ig.x || ig.y) attrs["data-raea-bevy-ignore-scroll"] = `${ig.x ? "x" : ""}${ig.y ? "y" : ""}`;+ }+ const at = p.scroll_position;+ if (at !== undefined) {+ if (!Array.isArray(at) || at.length !== 2 || !at.every(Number.isFinite)) throw new TypeError(`${who}: scroll_position is [x, y] in px, got ${JSON.stringify(at)}`);+ // (in the page's px: under a UiScale's zoom, physical ones)+ const [x, y] = [at[0] * scale, at[1] * scale];+ attrs["data-raea-bevy-scroll"] = `1 ${x} ${y}`;+ attrs.scrollLeft = o?.x === "Scroll" ? x : 0;+ attrs.scrollTop = o?.y === "Scroll" ? y : 0;+ }const w = p.scrollbar_width;if (w === undefined) return;if (!(Number.isFinite(w) && w >= 0)) throw new RangeError(`${who}: scrollbar_width is a number of px at least 0, got ${w}`);diff --git a/sdk/render/src/bevy3d/ui-scrollbar.tsx b/sdk/render/src/bevy3d/ui-scrollbar.tsxnew file mode 100644index 00000000..7a5cd632--- /dev/null+++ b/sdk/render/src/bevy3d/ui-scrollbar.tsx@@ -0,0 +1,55 @@+// bevy_ui_widgets' Scrollbar and ScrollbarThumb. The track is a Node laid out as any other; the thumb is not laid out+// (Bevy gives it no Node) but sized and placed in the track after layout from its target's ScrollPosition, as+// bevy_ui_widgets' update_scrollbar_thumb does (vendor/blitz-dom bevy_scroll.rs).+import { useContext, type ReactNode } from "react";+import { boxOf, InUi, nodeCss, UiScaleCx, type NodeProps } from "./ui";+import type { BorderRadius, UiRect } from "./ui-val";++/** bevy_ui_widgets' ControlOrientation. @bevy bevy_ui_widgets::ControlOrientation */+export type ControlOrientation = "Horizontal" | "Vertical";++export interface ScrollbarProps extends NodeProps {+ /** the Name of the Node it scrolls (an overflow Scroll one) */+ target: string;+ orientation: ControlOrientation;+ /** the thumb's least length, px */+ min_thumb_length: number;+ /** its ScrollbarThumb */+ children?: ReactNode;+}++/** A scrollbar's track: its ScrollbarThumb inside shows how much of its target is in view and where.+ * @bevy bevy_ui_widgets::Scrollbar */+export function Scrollbar({ target, orientation, min_thumb_length, children, ...p }: ScrollbarProps) {+ if (typeof target !== "string" || target === "" || /\s/.test(target)) throw new TypeError(`Scrollbar: target is a Node's name with no spaces, got ${JSON.stringify(target)}`);+ if (orientation !== "Horizontal" && orientation !== "Vertical") throw new TypeError(`Scrollbar: orientation is "Horizontal" or "Vertical", got ${JSON.stringify(orientation)}`);+ if (!(Number.isFinite(min_thumb_length) && min_thumb_length >= 0)) throw new RangeError(`Scrollbar: min_thumb_length is a number of px at least 0, got ${min_thumb_length}`);+ const ui = useContext(InUi);+ if (ui === null) throw new Error("Scrollbar: goes inside a Node");+ const scale = useContext(UiScaleCx);+ const n = nodeCss("Scrollbar", p, ui.back, scale);+ // (the least length in the page's px: under a UiScale's zoom, physical ones)+ n.attrs["data-raea-bevy-scrollbar"] = `${orientation === "Vertical" ? "v" : "h"} ${min_thumb_length * scale} ${target}`;+ return boxOf(n.css, n.back, children, false, undefined, n.attrs);+}++export interface ScrollbarThumbProps {+ border_radius?: BorderRadius;+ /** the border's width on each side */+ border?: UiRect;+ /** BackgroundColor */+ background_color?: NodeProps["background_color"];+ /** BorderColor, every side */+ border_color?: NodeProps["background_color"];+}++/** A Scrollbar's thumb: the track's width across it, its length the share of the target in view.+ * @bevy bevy_ui_widgets::ScrollbarThumb */+export function ScrollbarThumb({ border_radius, border, background_color, border_color }: ScrollbarThumbProps) {+ const ui = useContext(InUi);+ if (ui === null) throw new Error("ScrollbarThumb: goes inside a Scrollbar");+ const n = nodeCss("ScrollbarThumb", { border_radius, border, background_color, border_color }, ui.back, useContext(UiScaleCx));+ // (out of the track's layout: Blitz gives it its size and place)+ const css = { ...n.css, position: "absolute" as const, left: 0, top: 0 };+ return <div style={css} {...n.attrs} data-raea-bevy-thumb="1" />;+}diff --git a/sdk/render/src/bevy3d/ui.tsx b/sdk/render/src/bevy3d/ui.tsxindex 6981b2a5..06b8398d 100644--- a/sdk/render/src/bevy3d/ui.tsx+++ b/sdk/render/src/bevy3d/ui.tsx@@ -24,6 +24,8 @@ type Color = Srgba | LinearRgba | string;/** bevy_ui's Node: its layout fields as Bevy names them (each Bevy's default when left out), and the components that* draw it: background_color (BackgroundColor), border_color (BorderColor, every side), z_index (ZIndex). */export interface NodeProps {+ /** bevy_ecs's Name, as a Scrollbar's target names its scroller (the element's id) */+ name?: string;display?: (typeof DISPLAY)[number];box_sizing?: "BorderBox" | "ContentBox";position_type?: (typeof POSITION_TYPE)[number];@@ -48,6 +50,8 @@ export interface NodeProps {scrollbar_width?: number;/** IgnoreScroll: the axes it keeps its place on while its parent scrolls */ignore_scroll?: IgnoreScroll;+ /** ScrollPosition: how far its Scroll axes are scrolled, in px (kept in range and floored to physical px) */+ scroll_position?: [number, number];row_gap?: Val; column_gap?: Val;/** the grid's tracks (display Grid): RepeatedGridTracks (RepeatedGridTrack.fr(3, 1)) or GridTracks */grid_template_rows?: (RepeatedGridTrack | GridTrack)[]; grid_template_columns?: (RepeatedGridTrack | GridTrack)[];@@ -81,6 +85,8 @@ export interface NodeProps {// inside a Node (null at the top: a Node there is a root), and what lies under its content when knownexport const InUi = createContext<{ back: Backdrop } | null>(null);+// the UiScale the UI is drawn at: physical px to a logical one (a scale factor of 1)+export const UiScaleCx = createContext(1);const VALS = ["left", "right", "top", "bottom", "width", "height", "min_width", "min_height", "max_width", "max_height", "flex_basis", "row_gap", "column_gap"] as const;const CSS_OF: Record<(typeof VALS)[number], keyof CSSProperties> = {@@ -91,7 +97,7 @@ const CSS_OF: Record<(typeof VALS)[number], keyof CSSProperties> = {/** A Node's props as the box's CSS: Bevy's defaults made explicit where CSS's differ (display flex, border-box,* position relative, flex-shrink 1, min sizes auto; no font of the page's own), its colours blended as Bevy blends them over* `back`, and the backdrop it leaves its content. */-export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSProperties; back: Backdrop; attrs: Record<string, string> } {+export function nodeCss(who: string, p: NodeProps, back?: Backdrop, scale = 1): { css: CSSProperties; back: Backdrop; attrs: Record<string, string | number> } {const s: Record<string, unknown> = { display: "flex", boxSizing: "border-box", position: "relative", flexShrink: 1, minWidth: "auto", minHeight: "auto" };const kw = (k: keyof NodeProps, css: string, allowed: readonly string[]) => {const v = p[k];@@ -126,7 +132,7 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSP// every node a stacking context, so a ZIndex ranks it among its siblings above their parent, as bevy_ui stacks// them; a GlobalZIndex ranks it in the root's (raea's Blitz hoists it past every other, layout/paint_tree.rs)s.zIndex = p.global_z_index ?? p.z_index ?? 0;- const attrs: Record<string, string> = p.global_z_index ? { "data-raea-bevy-global-z": "" } : {};+ const attrs: Record<string, string | number> = p.global_z_index ? { "data-raea-bevy-global-z": "" } : {};if (p.margin !== undefined) s.margin = rectCss(who, "margin", p.margin);if (p.padding !== undefined) s.padding = rectCss(who, "padding", p.padding);if (p.border !== undefined) {@@ -173,7 +179,8 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSPs.overflowX = o.x.toLowerCase();s.overflowY = o.y.toLowerCase();}- scrollCss(who, p, s);+ if (p.name !== undefined) attrs.id = p.name;+ scrollCss(who, p, s, attrs, scale);const m = p.overflow_clip_margin;if (m !== undefined) {if (!["BorderBox", "PaddingBox", "ContentBox"].includes(m?.visual_box) || !(Number.isFinite(m.margin) && m.margin >= 0)) throw new TypeError(`${who}: overflow_clip_margin is OverflowClipMargin.border_box(), padding_box() or content_box(), with_margin(px >= 0), got ${JSON.stringify(m)}`);@@ -186,7 +193,7 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSP// a root's implicit viewport (bevy_ui ui_surface.rs): a grid the window's size, its one item at the start of both axesexport const VIEWPORT: CSSProperties = { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", display: "grid", alignItems: "start", justifyItems: "start" };-export function boxOf(css: CSSProperties, back: Backdrop, children: ReactNode, root: boolean | "fixed", font?: ReactNode, attrs?: Record<string, string>) {+export function boxOf(css: CSSProperties, back: Backdrop, children: ReactNode, root: boolean | "fixed", font?: ReactNode, attrs?: Record<string, string | number>) {const inner = (<div style={css} {...attrs}><InUi.Provider value={{ back }}>{children}</InUi.Provider>@@ -200,7 +207,7 @@ export function boxOf(css: CSSProperties, back: Backdrop, children: ReactNode, r* <AbsoluteFill> (after the <Canvas3D>): each root fills the frame as Bevy's window. @bevy bevy_ui::ui_node::Node */export function Node({ children, fixed, ...p }: NodeProps) {const ui = useContext(InUi);- const n = nodeCss("Node", p, ui?.back);+ const n = nodeCss("Node", p, ui?.back, useContext(UiScaleCx));return boxOf(n.css, n.back, children, fixed ? "fixed" : ui === null, undefined, n.attrs);}@@ -345,7 +352,7 @@ const BREAK: Record<NonNullable<TextProps["linebreak"]>, CSSProperties> = {* TextLayout and LineHeight (Bevy's defaults when left out). @bevy bevy_ui::widget::text::Text */export function Text({ children, font, font_size, weight, style, color, line_height, font_variations, font_features, letter_spacing, justify, linebreak, shadow, underline, strikethrough, underline_color, strikethrough_color, text_background_color, ...node }: TextProps) {const ui = useContext(InUi);- const n = nodeCss("Text", node, ui?.back);+ const n = nodeCss("Text", node, ui?.back, useContext(UiScaleCx));const t = textCss("Text", { font, font_size, weight, style, color, line_height, font_variations, font_features, letter_spacing }, n.back);if (justify !== undefined && !["Left", "Center", "Right", "Justified", "Start", "End"].includes(justify)) throw new TypeError(`Text: justify is Left, Center, Right, Justified, Start or End, got ${JSON.stringify(justify)}`);if (linebreak !== undefined && !(linebreak in BREAK)) throw new TypeError(`Text: linebreak is WordBoundary, AnyCharacter, WordOrCharacter or NoWrap, got ${JSON.stringify(linebreak)}`);@@ -418,13 +425,17 @@ export function Text2d({ transform, justify, children, ...text }: Text2dProps) {}-/** bevy_ui's UiScale: every UI length inside times `value` (2 draws a 16 px node 32 px). Its roots lay out in a window- * of the frame's size over `value`, which is then scaled up from its top left, as Bevy lays out in logical px and- * draws in physical ones. Text2d and the 2D and 3D parts aren't UI, so they stay as they are.+/** bevy_ui's UiScale: every UI length inside times `value` (2 draws a 16 px node 32 px), as CSS's zoom: laid out+ * and its text shaped at that size, in physical px, as Bevy lays out (a 3 px padding at 1.25 is 4 px, not 3 drawn 1.25+ * times as big). Text2d and the 2D and 3D parts aren't UI, so they stay as they are.* @bevy bevy_ui::UiScale */export function UiScale({ value, children }: { value: number; children?: ReactNode }) {if (!(Number.isFinite(value) && value > 0)) throw new RangeError(`UiScale: value is above 0, got ${value}`);- return <div style={{ position: "absolute", left: 0, top: 0, width: `${100 / value}%`, height: `${100 / value}%`, transform: `scale(${value})`, transformOrigin: "0 0" }}>{children}</div>;+ return (+ <div style={{ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", zoom: value }}>+ <UiScaleCx.Provider value={value}>{children}</UiScaleCx.Provider>+ </div>+ );}/** The UI camera's viewport (bevy_camera's Viewport on the Camera2d the UI draws through): its roots lay out in thisdiff --git a/sdk/skills/raea/reference/sdk.md b/sdk/skills/raea/reference/sdk.mdindex c8f6633b..3adeffe9 100644--- a/sdk/skills/raea/reference/sdk.md+++ b/sdk/skills/raea/reference/sdk.md@@ -99,7 +99,7 @@ with a capital, hooks with `use`. A component's props are in its file.## `raea/ui` (sdk/raea/src/ui.ts)-`AbsoluteFill`, `AngularColorStop`, `BorderRadius`, `BoxShadow`, `ColorStop`, `ConicGradient`, `CornerRadius`, `FontFeatureTag`, `FontSource`, `FontVariationTag`, `GhostNode`, `GridPlacement`, `GridTrack`, `ImageNode`, `ImagePlugin`, `InlineImage`, `LinearGradient`, `Node`, `Overflow`, `OverflowClipMargin`, `RadialGradient`, `RepeatedGridTrack`, `Rot2`, `Text`, `Text2d`, `TextShadow`, `TextSpan`, `TextureAtlasLayout`, `UiPosition`, `UiRect`, `UiScale`, `UiTargetCamera`, `UiTransform`, `Val2`, `Viewport`, `auto`, `percent`, `px`, `vh`, `vmax`, `vmin`, `vw`+`AbsoluteFill`, `AngularColorStop`, `BorderRadius`, `BoxShadow`, `ColorStop`, `ConicGradient`, `CornerRadius`, `FontFeatureTag`, `FontSource`, `FontVariationTag`, `GhostNode`, `GridPlacement`, `GridTrack`, `ImageNode`, `ImagePlugin`, `InlineImage`, `LinearGradient`, `Node`, `Overflow`, `OverflowClipMargin`, `RadialGradient`, `RepeatedGridTrack`, `Rot2`, `Scrollbar`, `ScrollbarThumb`, `Text`, `Text2d`, `TextShadow`, `TextSpan`, `TextureAtlasLayout`, `UiPosition`, `UiRect`, `UiScale`, `UiTargetCamera`, `UiTransform`, `Val2`, `Viewport`, `auto`, `percent`, `px`, `vh`, `vmax`, `vmin`, `vw`## `raea/video` (sdk/raea/src/video.ts)diff --git a/systems/page/src/ops.rs b/systems/page/src/ops.rsindex 291d1f02..5c967579 100644--- a/systems/page/src/ops.rs+++ b/systems/page/src/ops.rs@@ -92,6 +92,10 @@ pub fn apply(doc: &mut BaseDocument, nodes: &mut Nodes, ops: Vec<Op>) {if props.get("scrollEnd").is_some_and(|v| !v.is_null()) {out.push((id, "scrollEnd", 0.0));}+ // a bevy_ui Scrollbar track (sdk/render's Scrollbar), whose thumbs blitz-dom places after layout+ if props.contains_key("data-raea-bevy-scrollbar") {+ out.push((id, "scrollbar", 0.0));+ }};{let mut m = doc.mutate();@@ -281,7 +285,18 @@ pub fn apply(doc: &mut BaseDocument, nodes: &mut Nodes, ops: Vec<Op>) {}continue;}- let Some(node) = nodes.by_id.get(&id).copied().and_then(|n| doc.get_node_mut(n)) else { continue };+ if k == "scrollbar" {+ if let Some(&n) = nodes.by_id.get(&id) && !doc.scrollbars.contains(&n) {+ doc.scrollbars.push(n);+ }+ continue;+ }+ let Some(n) = nodes.by_id.get(&id).copied() else { continue };+ // (kept in its range once layout has its content: blitz-dom's scroll_set)+ if !doc.scroll_set.contains(&n) {+ doc.scroll_set.push(n);+ }+ let Some(node) = doc.get_node_mut(n) else { continue };let at = node.scroll_offset_mut();if k == "scrollTop" { at.y = v } else { at.x = v }node.insert_damage(crate::ALL_DAMAGE);diff --git a/vendor/blitz-dom/src/bevy_scroll.rs b/vendor/blitz-dom/src/bevy_scroll.rsnew file mode 100644index 00000000..bfaab6e9--- /dev/null+++ b/vendor/blitz-dom/src/bevy_scroll.rs@@ -0,0 +1,113 @@+//! raea: bevy_ui's scrolling after layout. A scroll offset the page set (scrollTop, scrollLeft) is kept in its+//! scroller's range, as Chrome clamps scrollTop, and a bevy_ui scroller's is floored to whole physical px, as bevy_ui's+//! layout floors ScrollPosition. A bevy_ui_widgets Scrollbar's thumb is sized and placed in its track from its+//! target's offset, as bevy_ui_widgets' update_scrollbar_thumb does (sdk/render's Scrollbar and ScrollbarThumb).++use crate::{BaseDocument, NodeId};+use markup5ever::LocalName;++/// A Scrollbar track's `data-raea-bevy-scrollbar`: "v" or "h", its min_thumb_length (px) and its target's HTML id+struct Bar {+ vertical: bool,+ min: f32,+ target: String,+}++fn bar(v: &str) -> Option<Bar> {+ let mut it = v.splitn(3, ' ');+ let vertical = match it.next()? {+ "v" => true,+ "h" => false,+ _ => return None,+ };+ let min = it.next()?.parse().ok()?;+ Some(Bar { vertical, min, target: it.next()?.to_string() })+}++/// bevy_ui_widgets' size_and_pos: the thumb's length and its offset along the track+pub fn size_and_pos(content: f32, visible: f32, track: f32, min: f32, offset: f32) -> (f32, f32) {+ if content <= visible {+ return (track, 0.0);+ }+ let size = (track * visible / content).max(min).min(track);+ let offset = offset.clamp(0.0, content - visible);+ (size, offset * (track - size) / (content - visible))+}++impl BaseDocument {+ pub(crate) fn resolve_bevy_scroll(&mut self) {+ self.scroll_set.retain(|id| self.nodes.get(*id).is_some());+ for &id in &self.scroll_set {+ let node = &mut self.nodes[id];+ let (max_x, max_y) = (node.final_layout().scroll_width() as f64, node.final_layout().scroll_height() as f64);+ let k = node.bevy_scroll_scale();+ let at = node.scroll_offset_mut();+ for (v, max) in [(&mut at.x, max_x), (&mut at.y, max_y)] {+ *v = v.clamp(0.0, max);+ if let Some(k) = k {+ *v = (*v * k).floor() / k;+ }+ }+ }+ self.scrollbars.retain(|id| self.nodes.get(*id).is_some());+ for i in 0..self.scrollbars.len() {+ self.place_thumbs(self.scrollbars[i]);+ }+ }++ fn place_thumbs(&mut self, track: NodeId) {+ let Some(b) = self.nodes[track].attr(LocalName::from("data-raea-bevy-scrollbar")).and_then(bar) else { return };+ let Some(target) = self.get_element_by_id(&b.target) else { return };+ let t = &self.nodes[target];+ let l = t.final_layout();+ let visible = (l.size.width - l.scrollbar_size.width, l.size.height - l.scrollbar_size.height);+ let content = (l.scrollable_overflow_rect.right, l.scrollable_overflow_rect.bottom);+ // (the offset the page asked for: bevy_ui_widgets reads ScrollPosition, which layout never clamps)+ let asked = t.bevy_scroll_asked().unwrap_or((0.0, 0.0));+ let size = self.nodes[track].final_layout().size;+ let (len, pos) = if b.vertical {+ size_and_pos(content.1, visible.1, size.height, b.min, asked.1)+ } else {+ size_and_pos(content.0, visible.0, size.width, b.min, asked.0)+ };+ let thumbs: Vec<NodeId> = self.nodes[track].children.iter().copied().filter(|c| self.nodes[*c].attr(LocalName::from("data-raea-bevy-thumb")).is_some()).collect();+ let set = |l: &mut taffy::Layout| {+ if b.vertical {+ l.size = taffy::Size { width: size.width, height: len };+ l.location = taffy::Point { x: 0.0, y: pos };+ } else {+ l.size = taffy::Size { width: len, height: size.height };+ l.location = taffy::Point { x: pos, y: 0.0 };+ }+ };+ for c in thumbs {+ set(self.nodes[c].final_layout_mut());+ set(self.nodes[c].unrounded_layout_mut());+ }+ }+}++#[cfg(test)]+mod tests {+ use super::{bar, size_and_pos};++ #[test]+ fn thumb_is_the_share_in_view_at_the_offset() {+ // 300 of content, 100 in view, a 100 track: a third of it, 10 down moves it 10 * 66.7 / 200+ let (len, pos) = size_and_pos(300.0, 100.0, 100.0, 8.0, 10.0);+ assert!((len - 100.0 / 3.0).abs() < 1e-4);+ assert!((pos - 10.0 * (100.0 - len) / 200.0).abs() < 1e-4);+ // the least length holds, the offset is kept in range, and content that fits fills the track+ assert_eq!(size_and_pos(10_000.0, 100.0, 100.0, 8.0, 0.0).0, 8.0);+ assert_eq!(size_and_pos(300.0, 100.0, 100.0, 8.0, 900.0).1, 100.0 - len);+ assert_eq!(size_and_pos(50.0, 100.0, 100.0, 8.0, 40.0), (100.0, 0.0));+ }++ #[test]+ fn track_attr_is_orientation_length_and_target() {+ let b = bar("v 8 scroll-area").unwrap();+ assert!(b.vertical && b.min == 8.0 && b.target == "scroll-area");+ assert!(!bar("h 0 a").unwrap().vertical);+ assert!(bar("x 8 a").is_none() && bar("v eight a").is_none() && bar("v 8").is_none());+ }+}diff --git a/vendor/blitz-dom/src/document.rs b/vendor/blitz-dom/src/document.rsindex 1ff7790d..f4c36f59 100644--- a/vendor/blitz-dom/src/document.rs+++ b/vendor/blitz-dom/src/document.rs@@ -388,6 +388,10 @@ pub struct BaseDocument {pub image_loads: Vec<(NodeId, Option<(u32, u32)>)>,/// raea: scrollers to scroll to their end once layout has their content (bevy-tsx's `scrollEnd`), taken by resolvepub scroll_to_end: Vec<NodeId>,+ /// raea: scrollers whose offset the page set (scrollTop, scrollLeft), kept in their range by resolve+ pub scroll_set: Vec<NodeId>,+ /// raea: bevy_ui Scrollbar tracks (data-raea-bevy-scrollbar), whose thumbs resolve places+ pub scrollbars: Vec<NodeId>,/// Nodes whose `background-image`/`mask-image` layers need flushing to/// dedicated storage on the node because their style changed (populated by@@ -554,6 +558,8 @@ impl BaseDocument {pending_images: HashMap::new(),image_loads: Vec::new(),scroll_to_end: Vec::new(),+ scroll_set: Vec::new(),+ scrollbars: Vec::new(),pending_style_image_nodes: Vec::new(),pending_critical_resources: HashSet::new(),controls_to_form: HashMap::new(),diff --git a/vendor/blitz-dom/src/lib.rs b/vendor/blitz-dom/src/lib.rsindex 45f7fd90..d73fc026 100644--- a/vendor/blitz-dom/src/lib.rs+++ b/vendor/blitz-dom/src/lib.rs@@ -54,6 +54,7 @@ mod layout;mod mutator;mod query_selector;mod resolve;+mod bevy_scroll;/// Computation of resolved CSS property values (`getComputedStyle()`)mod resolved_style;/// Scrolling of nodes and the viewport, and scroll animations.diff --git a/vendor/blitz-dom/src/node/node.rs b/vendor/blitz-dom/src/node/node.rsindex 3e9ae6cb..1470ebb6 100644--- a/vendor/blitz-dom/src/node/node.rs+++ b/vendor/blitz-dom/src/node/node.rs@@ -1010,6 +1010,25 @@ impl NodeData {self.attr(LocalName::from("data-raea-bevy-global-z")).is_some()}+ /// raea: a bevy_ui IgnoreScroll (sdk/render's `ignore_scroll`, `data-raea-bevy-ignore-scroll` "x", "y" or "xy"):+ /// the axes on which it keeps its place while its parent scrolls+ pub fn bevy_ignore_scroll(&self) -> Option<(bool, bool)> {+ let v = self.attr(LocalName::from("data-raea-bevy-ignore-scroll"))?;+ Some((v.contains('x'), v.contains('y')))+ }++ /// raea: a bevy_ui scroller (sdk/render's `scroll_position`, `data-raea-bevy-scroll`): its physical px per CSS px,+ /// to which bevy_ui floors its scroll offset+ pub fn bevy_scroll_scale(&self) -> Option<f64> {+ self.attr(LocalName::from("data-raea-bevy-scroll"))?.split(' ').next()?.parse().ok().filter(|s: &f64| *s > 0.0)+ }++ /// raea: the ScrollPosition a bevy_ui scroller was given (`data-raea-bevy-scroll` "scale x y", CSS px), unclamped+ pub fn bevy_scroll_asked(&self) -> Option<(f32, f32)> {+ let mut it = self.attr(LocalName::from("data-raea-bevy-scroll"))?.split(' ').skip(1).map(|v| v.parse().ok());+ Some((it.next()??, it.next()??))+ }+pub fn has_attr(&self, name: impl PartialEq<LocalName>) -> bool {self.downcast_element().is_some_and(|elem| elem.has_attr(name))@@ -1072,6 +1091,21 @@ impl Node {self.data.is_bevy_global_z()}+ /// raea: NodeData::bevy_ignore_scroll+ pub fn bevy_ignore_scroll(&self) -> Option<(bool, bool)> {+ self.data.bevy_ignore_scroll()+ }++ /// raea: NodeData::bevy_scroll_scale+ pub fn bevy_scroll_scale(&self) -> Option<f64> {+ self.data.bevy_scroll_scale()+ }++ /// raea: NodeData::bevy_scroll_asked+ pub fn bevy_scroll_asked(&self) -> Option<(f32, f32)> {+ self.data.bevy_scroll_asked()+ }+pub fn tree(&self) -> &crate::NodeTree {unsafe { &*self.tree }}diff --git a/vendor/blitz-dom/src/resolve.rs b/vendor/blitz-dom/src/resolve.rsindex a283e98b..9b45e06b 100644--- a/vendor/blitz-dom/src/resolve.rs+++ b/vendor/blitz-dom/src/resolve.rs@@ -140,6 +140,9 @@ impl BaseDocument {node.scroll_offset_mut().y = end;}}+ // raea: scroll offsets the page set kept in range and bevy_ui Scrollbar thumbs placed, now that layout has the+ // content (bevy_scroll.rs)+ self.resolve_bevy_scroll();// Resolve transformsself.resolve_transforms(root_node_id, None, None);@@ -243,9 +246,11 @@ impl BaseDocument {// one in a 3D rendering context, whose projection is its context's matrix times its own (a script setting the// preserve-3d parent's transform left its children at their old projection, #19), and one with a projection// now, which may have lost its context since+ // (a bevy_ui IgnoreScroll node is placed again too: its parent's scroll moves it)if perspective.is_none()&& context.is_none()&& !self.projections.contains_key(&node_id)+ && self.nodes[node_id].bevy_ignore_scroll().is_none()&& !self.nodes[node_id].damage().map(|d| d.contains(style::selector_parser::RestyleDamage::RECALCULATE_OVERFLOW))@@ -263,8 +268,21 @@ impl BaseDocument {return transform.transform_rect_bbox(overflow);}- let (transform, projection, context) =+ let (mut transform, projection, context) =self.nodes[node_id].set_transform(scale as f32, perspective.as_ref(), context.as_ref());+ // raea: a bevy_ui IgnoreScroll node keeps its place on its axes while its parent scrolls (bevy_ui's layout leaves+ // the parent's scroll out of its position): moved back by that scroll, after its own transform+ if let Some((ix, iy)) = self.nodes[node_id].bevy_ignore_scroll()+ && let Some(parent) = self.nodes[node_id].parent+ {+ let s = *self.nodes[parent].scroll_offset();+ let (dx, dy) = (if ix { s.x } else { 0.0 }, if iy { s.y } else { 0.0 });+ if dx != 0.0 || dy != 0.0 {+ let t = Affine::translate((dx * scale, dy * scale)) * transform.unwrap_or(Affine::IDENTITY);+ *self.nodes[node_id].transform_mut() = Some(Box::new(t));+ transform = Some(t);+ }+ }match projection {Some(p) => {self.projections.insert(node_id, p);