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/images/image_node_resizing passes (SSIM 0.9981, worst tile 9). It brings bevy_ui's debug overlay and NodeImageMode's Auto and Stretch.
shinyobjectze4bab2a77a94
diff --git a/bench/bevy-parity/examples.list b/bench/bevy-parity/examples.listindex 3f3291f5..426f16c9 100644--- a/bench/bevy-parity/examples.list+++ b/bench/bevy-parity/examples.list@@ -88,3 +88,4 @@ ui/scroll_and_overflow/drag_to_scrollui/scroll_and_overflow/scrollbarsui/scroll_and_overflow/overflow_debugui/text/font_query+ui/images/image_node_resizingdiff --git a/bench/bevy-parity/runs.tsv b/bench/bevy-parity/runs.tsvindex c8266561..460ba70d 100644--- a/bench/bevy-parity/runs.tsv+++ b/bench/bevy-parity/runs.tsv@@ -87,3 +87,4 @@ ui/scroll_and_overflow/drag_to_scroll - 10ui/scroll_and_overflow/scrollbars - 10ui/scroll_and_overflow/overflow_debug - 10ui/text/font_query - 10+ui/images/image_node_resizing - 10diff --git a/docs/bevy-parity.md b/docs/bevy-parity.mdindex 44a10644..4608ac18 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 **88**, passing **84**, excluded **16** (docs/bevy-parity/excluded.tsv), left **338**.+Examples: **438**, ported **89**, passing **85**, excluded **16** (docs/bevy-parity/excluded.tsv), left **337**.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.@@ -97,14 +97,10 @@ doesn't pay.| ui/styling/transparency_ui | 5 | 0.999721 | 3 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 58.038 / 2.091 = 1.908 + 0.183 | yes | || ui/layout/fixed_node | 10 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 1.826 / 1.813 = 1.658 + 0.155 | yes | || ui/layout/fixed_node | 5 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 59.165 / 2.544 = 2.294 + 0.250 | yes | |-| ui/images/image_node | 10 | 0.999965 | 0 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 2.492 / 2.281 = 2.117 + 0.164 | yes | |-| ui/images/image_node | 5 | 0.999965 | 0 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 64.462 / 2.143 = 1.943 + 0.200 | yes | || ui/text/text_background_colors | 10 | 0.998841 | 7 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 1.94 / 1.302 = 1.129 + 0.173 | yes | || ui/text/text_background_colors | 5 | 0.998841 | 7 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 64.804 / 2.805 = 2.572 + 0.233 | yes | || ui/scroll_and_overflow/overflow | 10 | 0.998763 | 4 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 2.902 / 1.514 = 1.278 + 0.236 | yes | || ui/scroll_and_overflow/overflow | 5 | 0.998763 | 4 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 65.578 / 3.526 = 3.193 + 0.333 | yes | |-| ui/images/ui_texture_atlas | 10 | 0.999776 | 6 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 2.056 / 1.477 = 1.213 + 0.264 | yes | |-| ui/images/ui_texture_atlas | 5 | 0.999776 | 6 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 62.032 / 2.768 = 2.601 + 0.167 | yes | || 2d/mesh2d_vertex_color_texture | 10 | 0.998651 | 6 | 0 / 0 | 442 / 495 | 6 / 9 | 1 / 1 | 37.793 / 2.711 = 1.347 + 1.364 | yes | || 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 | |@@ -113,7 +109,6 @@ doesn't pay.| 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 | || ui/window_fallthrough | 10 | 0.992068 | 16 | 0 / 0 | 441 / 492 | 5 / 7 | 1 / 1 | 32.32 / 1.116 = 0.98 + 0.136 | yes | |-| ui/text/inline_image | 10 | 0.998473 | 8 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 32.909 / 1.345 = 1.127 + 0.218 | yes | || ui/layout/z_index | 10 | 1.000000 | 0 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 32.169 / 1.386 = 1.231 + 0.155 | yes | || ui/styling/stacked_gradients | 10 | 0.994550 | 1 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 46.978 / 1.428 = 1.255 + 0.173 | yes | || ui/styling/gradients | 10 | 0.988141 | 14 | 0 / 0 | 553 / 492 | 5 / 7 | 1 / 1 | 40.253 / 4.425 = 2.089 + 2.336 | yes | |@@ -123,18 +118,12 @@ doesn't pay.| ui/layout/grid | 10 | 0.995059 | 14 | 0 / 0 | 482 / 492 | 5 / 7 | 1 / 1 | 34.457 / 1.496 = 1.496 + 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 | || 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 | 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 | |-| ui/scroll_and_overflow/overflow_debug | 10 | 0.996511 | 10 | 0 / 0 | 463 / 492 | 5 / 7 | 1 / 1 | 38.277 / 1.215 = 1.215 + 0 | yes | || ui/text/font_weights | 10 | 0.991774 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 2.498 / 1.731 = 1.731 + 0 | yes | || ui/text/font_weights | 5 | 0.991774 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 72.229 / 2.06 = 2.06 + 0 | yes | || ui/text/strikethrough_and_underline | 10 | 0.990823 | 15 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 2.3 / 2.548 = 2.548 + 0 | yes | |@@ -144,6 +133,18 @@ doesn't pay.| ui/text/font_variations | 10 | 0.993984 | 20 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 2.066 / 1.468 = 1.468 + 0 | yes | || ui/text/font_variations | 5 | 0.993984 | 20 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 73.631 / 2.268 = 2.268 + 0 | yes | || ui/text/font_query | 10 | 0.993297 | 19 | 0 / 0 | 467 / 492 | 5 / 7 | 1 / 1 | 53.646 / 2.847 = 2.847 + 0 | yes | |+| ui/images/image_node | 10 | 0.999965 | 0 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 2.37 / 1.44 = 1.44 + 0 | yes | |+| ui/images/image_node | 5 | 0.999965 | 0 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 80.896 / 2.154 = 2.154 + 0 | yes | |+| ui/images/ui_texture_atlas | 10 | 0.999776 | 6 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 1.721 / 1.091 = 1.091 + 0 | yes | |+| ui/images/ui_texture_atlas | 5 | 0.999776 | 6 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 67.844 / 3.078 = 3.078 + 0 | yes | |+| ui/images/ui_texture_slice | 10 | 0.998941 | 8 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 38.224 / 1.264 = 1.264 + 0 | yes | |+| ui/images/ui_texture_atlas_slice | 10 | 0.990813 | 16 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 42.832 / 2.831 = 2.831 + 0 | yes | |+| ui/images/ui_texture_slice_flip_and_tile | 10 | 1.000000 | 0 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 45.245 / 2.59 = 2.59 + 0 | yes | |+| ui/text/inline_image | 10 | 0.998473 | 8 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 43.171 / 2.018 = 2.018 + 0 | yes | |+| ui/ui_scaling | 10 | 0.999856 | 5 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 42.162 / 2.411 = 2.411 + 0 | yes | |+| ui/scroll_and_overflow/overflow_transform | 10 | 0.995397 | 12 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 45.188 / 2.255 = 2.255 + 0 | yes | |+| ui/scroll_and_overflow/overflow_debug | 10 | 0.996511 | 10 | 0 / 0 | 463 / 492 | 5 / 7 | 1 / 1 | 39.92 / 1.736 = 1.736 + 0 | yes | |+| ui/images/image_node_resizing | 10 | 0.998112 | 9 | 0 / 0 | 455 / 492 | 5 / 7 | 1 / 1 | 31.752 / 1.604 = 1.604 + 0 | yes | |## Excludeddiff --git a/docs/bevy-parity/results.jsonl b/docs/bevy-parity/results.jsonlindex 64e8ec6e..ef8da7e0 100644--- a/docs/bevy-parity/results.jsonl+++ b/docs/bevy-parity/results.jsonl@@ -84,14 +84,10 @@{"example":"ui/styling/transparency_ui","frame":5,"ssim":0.999721,"tile":3,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":58.038,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.908,"step_ms":0.183,"cost_ms":2.091},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/fixed_node","frame":10,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":0,"entities":444,"extents":[],"frame":10,"frame_ms":1.826,"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.658,"step_ms":0.155,"cost_ms":1.813},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/fixed_node","frame":5,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":0,"entities":444,"extents":[],"frame":5,"frame_ms":59.165,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.294,"step_ms":0.250,"cost_ms":2.544},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/image_node","frame":10,"ssim":0.999965,"tile":0,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":2.492,"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.117,"step_ms":0.164,"cost_ms":2.281},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/image_node","frame":5,"ssim":0.999965,"tile":0,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":5,"frame_ms":64.462,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.943,"step_ms":0.200,"cost_ms":2.143},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/text_background_colors","frame":10,"ssim":0.998841,"tile":7,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":10,"frame_ms":1.94,"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":0.173,"cost_ms":1.302},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/text_background_colors","frame":5,"ssim":0.998841,"tile":7,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":5,"frame_ms":64.804,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.572,"step_ms":0.233,"cost_ms":2.805},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/scroll_and_overflow/overflow","frame":10,"ssim":0.998763,"tile":4,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":10,"frame_ms":2.902,"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.278,"step_ms":0.236,"cost_ms":1.514},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/scroll_and_overflow/overflow","frame":5,"ssim":0.998763,"tile":4,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":5,"frame_ms":65.578,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":3.193,"step_ms":0.333,"cost_ms":3.526},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/ui_texture_atlas","frame":10,"ssim":0.999776,"tile":6,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":2.056,"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.213,"step_ms":0.264,"cost_ms":1.477},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/images/ui_texture_atlas","frame":5,"ssim":0.999776,"tile":6,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":62.032,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.601,"step_ms":0.167,"cost_ms":2.768},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"2d/mesh2d_vertex_color_texture","frame":10,"ssim":0.998651,"tile":6,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":37.793,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":17,"entities":495,"mesh_entities":0,"visible":0,"meshes":9,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.347,"step_ms":1.364,"cost_ms":2.711},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"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":""}@@ -100,7 +96,6 @@{"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":""}{"example":"ui/window_fallthrough","frame":10,"ssim":0.992068,"tile":16,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":32.32,"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.136,"cost_ms":1.116},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}-{"example":"ui/text/inline_image","frame":10,"ssim":0.998473,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":32.909,"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.127,"step_ms":0.218,"cost_ms":1.345},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/z_index","frame":10,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":32.169,"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.231,"step_ms":0.155,"cost_ms":1.386},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/styling/stacked_gradients","frame":10,"ssim":0.994550,"tile":1,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":46.978,"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.255,"step_ms":0.173,"cost_ms":1.428},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/styling/gradients","frame":10,"ssim":0.988141,"tile":14,"bevy":{"batch_keys":0,"entities":553,"extents":[],"frame":10,"frame_ms":40.253,"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.089,"step_ms":2.336,"cost_ms":4.425},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}@@ -110,18 +105,12 @@{"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/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":""}{"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":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":""}-{"example":"ui/scroll_and_overflow/overflow_debug","frame":10,"ssim":0.996511,"tile":10,"bevy":{"batch_keys":0,"entities":463,"extents":[],"frame":10,"frame_ms":38.277,"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.215,"step_ms":null,"cost_ms":1.215},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/font_weights","frame":10,"ssim":0.991774,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":2.498,"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.731,"step_ms":null,"cost_ms":1.731},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/font_weights","frame":5,"ssim":0.991774,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":5,"frame_ms":72.229,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.06,"step_ms":null,"cost_ms":2.06},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/strikethrough_and_underline","frame":10,"ssim":0.990823,"tile":15,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":2.3,"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.548,"step_ms":null,"cost_ms":2.548},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}@@ -131,3 +120,15 @@{"example":"ui/text/font_variations","frame":10,"ssim":0.993984,"tile":20,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":10,"frame_ms":2.066,"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.468,"step_ms":null,"cost_ms":1.468},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/font_variations","frame":5,"ssim":0.993984,"tile":20,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":5,"frame_ms":73.631,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.268,"step_ms":null,"cost_ms":2.268},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/font_query","frame":10,"ssim":0.993297,"tile":19,"bevy":{"batch_keys":0,"entities":467,"extents":[],"frame":10,"frame_ms":53.646,"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.847,"step_ms":null,"cost_ms":2.847},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/image_node","frame":10,"ssim":0.999965,"tile":0,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":2.37,"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.44,"step_ms":null,"cost_ms":1.44},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/image_node","frame":5,"ssim":0.999965,"tile":0,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":5,"frame_ms":80.896,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.154,"step_ms":null,"cost_ms":2.154},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/ui_texture_atlas","frame":10,"ssim":0.999776,"tile":6,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":1.721,"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.091,"step_ms":null,"cost_ms":1.091},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/ui_texture_atlas","frame":5,"ssim":0.999776,"tile":6,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":67.844,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":3.078,"step_ms":null,"cost_ms":3.078},"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":38.224,"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.264,"step_ms":null,"cost_ms":1.264},"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":42.832,"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.831,"step_ms":null,"cost_ms":2.831},"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":45.245,"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.59,"step_ms":null,"cost_ms":2.59},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/text/inline_image","frame":10,"ssim":0.998473,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":43.171,"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.018,"step_ms":null,"cost_ms":2.018},"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":42.162,"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.411,"step_ms":null,"cost_ms":2.411},"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":45.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":2.255,"step_ms":null,"cost_ms":2.255},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/scroll_and_overflow/overflow_debug","frame":10,"ssim":0.996511,"tile":10,"bevy":{"batch_keys":0,"entities":463,"extents":[],"frame":10,"frame_ms":39.92,"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.736,"step_ms":null,"cost_ms":1.736},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/images/image_node_resizing","frame":10,"ssim":0.998112,"tile":9,"bevy":{"batch_keys":0,"entities":455,"extents":[],"frame":10,"frame_ms":31.752,"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.604,"step_ms":null,"cost_ms":1.604},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}diff --git a/runtime/page/src/elements.rs b/runtime/page/src/elements.rsindex fec26fd7..73187a53 100644--- a/runtime/page/src/elements.rs+++ b/runtime/page/src/elements.rs@@ -220,7 +220,7 @@ pub(crate) fn page_props(kind: &str, props: Option<&Map<String, Value>>, dir: &P// 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)- 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"];+ const KEPT: [&str; 12] = ["data-raea-start", "data-raea-bevy-debug", "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;}diff --git a/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx b/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsxnew file mode 100644index 00000000..d8f4b0e7--- /dev/null+++ b/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx@@ -0,0 +1,44 @@+// Bevy v0.20.0 examples/ui/images/image_node_resizing.rs in raea's TSX: a white grid filling the window, its rows+// min-content and the rest: the black instructions (6 px padding, Bevy's default font) over a black column (10 px+// padding, spaced around) of two light-blue (tailwind BLUE_100) groups 75% wide and 30% high: four icon.png+// ImageNodes in NodeImageMode::Auto, then four in Stretch, 10%, 20%, 30% and 40% wide and the group's height. Bevy's+// GlobalUiDebugOptions outlines every node but the text's, each coloured by its entity's index: setup's Commands+// reserve them in spawn order from the camera's, 430 (DefaultPlugins' startup entities before it; the text's+// observer comes later, when the commands apply). The arrows resize the groups only while held. Bevy's Camera2d over+// the default clear colour is the layered <Canvas3D>. In Bevy's default 1280 x 720 window.+import type { ReactNode } from "react";+import { AbsoluteFill, Composition, registerRoot, staticFile } from "raea";+import { Canvas3D } from "raea/3d";+import { GlobalUiDebugOptions, GridPlacement, GridTrack, ImageNode, Node, Text, UiRect, percent, px } from "raea/ui";+import { Srgba } from "raea/color";++const ICON = staticFile("branding/icon.png");+// tailwind BLUE_100 (bevy_color's palettes::tailwind): #dbeafe+const BLUE_100 = new Srgba(0xdb / 255, 0xea / 255, 0xfe / 255);+const PREFIX = "Compare NodeImageMode(Auto, Stretch) press `Up`/`Down` to resize height, press `Left`/`Right` to resize width\n";+// each node's entity index: the camera's, then setup's spawns in order+const CAMERA = 430;+const at = (k: number) => CAMERA + k;++const Group = ({ index, children }: { index: number; children: ReactNode }) => (+ <Node debug_color_index={index} display="Flex" justify_content="Start" width={percent(75)} height={percent(30)} background_color={BLUE_100}>{children}</Node>+);++function Shot() {+ return (+ <AbsoluteFill>+ <Canvas3D layered clearColor="rgb(43, 44, 47)" />+ <GlobalUiDebugOptions enabled>+ <Node debug_color_index={at(1)} display="Grid" width={percent(100)} height={percent(100)} grid_template_rows={[GridTrack.min_content(), GridTrack.flex(1)]} background_color={new Srgba(1, 1, 1)}>+ <Text ui_debug={{ enabled: false }} grid_row={GridPlacement.span(1)} padding={UiRect.all(px(6))} color={new Srgba(0, 0, 0)}>{`${PREFIX}height : 30%, width : 75%`}</Text>+ <Node debug_color_index={at(3)} display="Flex" grid_row={GridPlacement.span(1)} flex_direction="Column" justify_content="SpaceAround" padding={UiRect.all(px(10))} background_color={new Srgba(0, 0, 0)}>+ <Group index={at(4)}>{[0, 1, 2, 3].map((i) => <ImageNode key={i} debug_color_index={at(5 + i)} image={ICON} />)}</Group>+ <Group index={at(9)}>{[10, 20, 30, 40].map((w, i) => <ImageNode key={w} debug_color_index={at(10 + i)} image={ICON} image_mode="Stretch" height={percent(100)} width={percent(w)} />)}</Group>+ </Node>+ </Node>+ </GlobalUiDebugOptions>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);diff --git a/sdk/raea/conformance/ui-debug.test.tsx b/sdk/raea/conformance/ui-debug.test.tsxnew file mode 100644index 00000000..9c62b119--- /dev/null+++ b/sdk/raea/conformance/ui-debug.test.tsx@@ -0,0 +1,38 @@+// docs/control.feature FC0a: bevy_ui's debug overlay (GlobalUiDebugOptions, UiDebugOptions) on the page+// (ui/images/image_node_resizing). Blitz draws the outlines over every UI node (vendor/blitz-paint bevy_debug.rs).+import { describe, expect, test } from "bun:test";+import { GlobalUiDebugOptions, Node, Text, UiScale } from "raea/ui";+import { Srgba } from "raea/color";+import { sequentialDispersed } from "../../render/src/bevy3d/ui-debug";+import { renderFrame } from "../src/test";++const html = (el: React.ReactElement) => renderFrame(el, { frame: 0, width: 320, height: 240, fps: 30, durationInFrames: 30 });+const hex = (i: number) => "#" + sequentialDispersed(i).map((v) => Math.round(v * 255).toString(16).padStart(2, "0")).join("");++describe("Hsla::sequential_dispersed: an outline's colour by its node's index", () => {+ test("bevy_color's golden-ratio hues at s 1, l 0.5 (as Bevy drew image_node_resizing's entities 431 to 443)", () => {+ expect(hex(0)).toBe("#ff0000");+ expect([431, 433, 434, 443].map(hex)).toEqual(["#00ff3c", "#0059ff", "#a3ff00", "#bb00ff"]);+ });+});++describe("GlobalUiDebugOptions and a node's own UiDebugOptions", () => {+ test("off unless enabled; enabled, every node inside outlines its border box 1 px in its index's colour", () => {+ expect(html(<Node debug_color_index={3} />)).not.toContain("data-raea-bevy-debug");+ const [r, g, b] = sequentialDispersed(3);+ expect(html(<GlobalUiDebugOptions enabled><Node debug_color_index={3} /></GlobalUiDebugOptions>)).toContain(`data-raea-bevy-debug="1 ${r} ${g} ${b} 1 b 0"`);+ });+ test("a node's own options replace the global ones (Text's too); an override colour, more boxes, show_clipped", () => {+ const off = html(<GlobalUiDebugOptions enabled><Text ui_debug={{ enabled: false }}>a</Text></GlobalUiDebugOptions>);+ expect(off).not.toContain("data-raea-bevy-debug");+ const own = html(<Node ui_debug={{ enabled: true, line_width: 2, line_color_override: new Srgba(1, 0, 0, 0.5), outline_padding_box: true, outline_content_box: true, show_clipped: true }} />);+ expect(own).toContain('data-raea-bevy-debug="2 1 0 0 0.5 bpc 1"');+ });+ test("its width in the page's px: times a UiScale's zoom", () => {+ expect(html(<UiScale value={2}><GlobalUiDebugOptions enabled line_width={1.5}><Node /></GlobalUiDebugOptions></UiScale>)).toContain('data-raea-bevy-debug="3 ');+ });+ test("refuses a negative width or a fractional index", () => {+ expect(() => html(<Node ui_debug={{ enabled: true, line_width: -1 }} />)).toThrow(/line_width/);+ expect(() => html(<GlobalUiDebugOptions enabled><Node debug_color_index={1.5} /></GlobalUiDebugOptions>)).toThrow(/debug_color_index/);+ });+});diff --git a/sdk/raea/conformance/ui.test.tsx b/sdk/raea/conformance/ui.test.tsxindex 3aec5767..080d4a2f 100644--- a/sdk/raea/conformance/ui.test.tsx+++ b/sdk/raea/conformance/ui.test.tsx@@ -89,10 +89,15 @@ describe("Text and TextSpan: bevy_text's defaults, and a span takes nothing from});describe("ImageNode, Underline and Strikethrough", () => {- test("an ImageNode is its picture on a Node, filling its content box; a root one sits in its viewport", () => {+ test("an ImageNode is its picture on a Node, contained in its content box (Auto); a root one sits in its viewport", () => {const out = html(<ImageNode image="branding/icon.png" width={px(256)} padding={UiRect.all(px(10))} flip_x />);expect(out).toContain('<img src="branding/icon.png"');- for (const s of ["display:grid", "width:256px", "padding:10px 10px 10px 10px", "object-fit:fill", "transform:scaleX(-1)"]) expect(out).toContain(s);+ for (const s of ["display:grid", "width:256px", "padding:10px 10px 10px 10px", "object-fit:contain", "transform:scaleX(-1)"]) expect(out).toContain(s);+ // Stretch: no <img> (no picture size for layout), the picture stretched over the content box+ const st = html(<Node><ImageNode image="a.png" image_mode="Stretch" width={percent(10)} /></Node>);+ expect(st).not.toContain("<img");+ for (const s of ["background-image:url("a.png")", "background-size:100% 100%", "background-origin:content-box"]) expect(st).toContain(s);+ expect(() => html(<ImageNode image="a.png" image_mode={"Fit" as "Auto"} />)).toThrow(/image_mode is "Auto", "Stretch" or/);expect(html(<Node><ImageNode image="a.png" color={new Srgba(0.5, 0.5, 0.5)} /></Node>)).toContain("filter:brightness(0.5)");});test("an ImageNode with children, a coloured tint or no picture is refused", () => {diff --git a/sdk/raea/src/ui.ts b/sdk/raea/src/ui.tsindex 06b19a0c..cea0b6ab 100644--- a/sdk/raea/src/ui.ts+++ b/sdk/raea/src/ui.ts@@ -11,5 +11,6 @@ export { LinearGradient, RadialGradient, ConicGradient, ColorStop, AngularColorSexport { GridTrack, RepeatedGridTrack, GridPlacement, type GridTrackRepetition, type GridAutoFlow, type MinTrackSizingFunction, type MaxTrackSizingFunction, FontSource, type GenericFontFamily } from "@raea/render/bevy3d";export { Rot2, Val2, UiTransform, BoxShadow, type ShadowStyle } from "@raea/render/bevy3d";export { FontFeatureTag, FontWidth } from "@raea/render/bevy3d";+export { GlobalUiDebugOptions, type UiDebugOptions } 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 28fb81a2..dede4273 100644--- a/sdk/render/src/bevy3d.tsx+++ b/sdk/render/src/bevy3d.tsx@@ -35,6 +35,7 @@ export { LinearGradient, RadialGradient, ConicGradient, ColorStop, AngularColorSexport { GridTrack, RepeatedGridTrack, GridPlacement, type GridTrackRepetition, type GridAutoFlow, type MinTrackSizingFunction, type MaxTrackSizingFunction } from "./bevy3d/ui-grid";export { Rot2, Val2, UiTransform, BoxShadow, type ShadowStyle } from "./bevy3d/ui-transform";export { FontFeatureTag, FontWidth } from "./bevy3d/ui-features";+export { GlobalUiDebugOptions, type UiDebugOptions } from "./bevy3d/ui-debug";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-debug.tsx b/sdk/render/src/bevy3d/ui-debug.tsxnew file mode 100644index 00000000..c0256a7c--- /dev/null+++ b/sdk/render/src/bevy3d/ui-debug.tsx@@ -0,0 +1,52 @@+// bevy_ui's debug overlay: GlobalUiDebugOptions over a UI, a node's own UiDebugOptions in its place, drawn by raea's+// Blitz over every UI node (vendor/blitz-paint render/bevy_debug.rs) from each node's data-raea-bevy-debug.+import { createContext, useContext, type ReactNode } from "react";+import type { Srgba } from "./colors";++/** bevy_ui's UiDebugOptions (and GlobalUiDebugOptions): which of a node's boxes to outline, how thick (px), in what+ * colour (each node its own by default), and whether a clipped or hidden node's outline shows. Every field Bevy's+ * default when left out. @bevy bevy_ui_render::UiDebugOptions */+export interface UiDebugOptions {+ enabled?: boolean;+ outline_border_box?: boolean;+ outline_padding_box?: boolean;+ outline_content_box?: boolean;+ line_width?: number;+ /** one colour for every outline, instead of each node's (Hsla::sequential_dispersed of its index) */+ line_color_override?: Srgba;+ /** an outline not cut by its ancestors' overflow */+ show_clipped?: boolean;+}++const Global = createContext<UiDebugOptions | null>(null);++/** bevy_ui's GlobalUiDebugOptions: the debug overlay for every node inside that has no UiDebugOptions of its own+ * (a node's `ui_debug`). @bevy bevy_ui_render::GlobalUiDebugOptions */+export function GlobalUiDebugOptions({ children, ...options }: UiDebugOptions & { children?: ReactNode }) {+ return <Global.Provider value={options}>{children}</Global.Provider>;+}++/** bevy_color's Hsla::sequential_dispersed(index) as sRGB (s 1, l 0.5): a hue by the golden ratio, so that near+ * indices differ most, as bevy_ui colours a node's outline by its entity's index */+export function sequentialDispersed(index: number): [number, number, number] {+ const RATIO_360 = Math.fround(360 / Math.fround(4294967295));+ const hue = Math.fround(Math.fround(Math.imul(index >>> 0, 2654435769) >>> 0) * RATIO_360);+ const k = (n: number) => (n + hue / 30) % 12;+ const f = (n: number) => 0.5 - 0.5 * Math.max(-1, Math.min(k(n) - 3, 9 - k(n), 1));+ return [f(0), f(8), f(4)];+}++/** A node's debug outline marker (data-raea-bevy-debug, "width r g b a boxes clipped"), from its own UiDebugOptions or+ * else the GlobalUiDebugOptions it's in; nothing when neither is enabled. Called while its component renders. */+export function useDebugAttr(who: string, own: UiDebugOptions | undefined, index: number | undefined, scale: number): string | undefined {+ const global = useContext(Global);+ const o = own ?? global;+ if (!o?.enabled) return undefined;+ const w = o.line_width ?? 1;+ if (!(Number.isFinite(w) && w >= 0)) throw new RangeError(`${who}: ui_debug.line_width is px at least 0, got ${w}`);+ if (index !== undefined && !(Number.isInteger(index) && index >= 0)) throw new RangeError(`${who}: debug_color_index is a whole number at least 0, got ${index}`);+ const c = o.line_color_override;+ const [r, g, b, a] = c ? [c.red, c.green, c.blue, c.alpha] : [...sequentialDispersed(index ?? 0), 1];+ const boxes = `${(o.outline_border_box ?? true) ? "b" : ""}${o.outline_padding_box ? "p" : ""}${o.outline_content_box ? "c" : ""}`;+ return boxes ? `${w * scale} ${r} ${g} ${b} ${a} ${boxes} ${o.show_clipped ? 1 : 0}` : undefined;+}diff --git a/sdk/render/src/bevy3d/ui-image.tsx b/sdk/render/src/bevy3d/ui-image.tsxindex 1699c306..80770e34 100644--- a/sdk/render/src/bevy3d/ui-image.tsx+++ b/sdk/render/src/bevy3d/ui-image.tsx@@ -17,9 +17,11 @@ export interface ImageNodeProps extends NodeProps {flip_y?: boolean;/** TextureAtlas: the one cell of a sheet laid out by a TextureAtlasLayout to draw (the picture is the sheet) */texture_atlas?: { layout: TextureAtlasLayout; index: number };- /** NodeImageMode: Sliced cuts the picture in nine by a TextureSlicer (its corners kept, its sides and centre- * stretched or tiled), drawn as CSS border-image with bevy_ui's scale; a sliced ImageNode holds children */- image_mode?: { Sliced: TextureSlicer };+ /** NodeImageMode: "Auto" (the default) sizes the node by the picture and draws it contained in the content box,+ * its aspect kept; "Stretch" gives the node no size of its own and stretches the picture over its content box;+ * Sliced cuts the picture in nine by a TextureSlicer (its corners kept, its sides and centre stretched or tiled),+ * drawn as CSS border-image with bevy_ui's scale; a sliced ImageNode holds children */+ image_mode?: "Auto" | "Stretch" | { Sliced: TextureSlicer };}/** bevy_ui's SliceScaleMode: a side or the centre stretched, or tiled every slice x stretch_value px from its start */@@ -56,7 +58,8 @@ export function ImageNode({ image, color, flip_x, flip_y, children, fixed, textuconst filter = s.filter === "nearest" ? "Nearest" : s.filter === "linear" ? "Linear" : outer;return <Sampler.Provider value={filter}><ImageNode image={image.path} color={color} flip_x={flip_x} flip_y={flip_y} fixed={fixed} texture_atlas={texture_atlas} image_mode={image_mode} {...p}>{children}</ImageNode></Sampler.Provider>;}- if (image_mode !== undefined) return SlicedNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, image_mode, ...p });+ if (image_mode !== undefined && image_mode !== "Auto" && image_mode !== "Stretch" && typeof image_mode?.Sliced !== "object") throw new TypeError(`ImageNode: image_mode is "Auto", "Stretch" or { Sliced }, got ${JSON.stringify(image_mode)}`);+ if (typeof image_mode === "object") return SlicedNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, image_mode, ...p });if (texture_atlas !== undefined) return AtlasNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, ...p });if (typeof image !== "string" || image === "") throw new TypeError(`ImageNode: image is a picture file (staticFile("x.png")), got ${JSON.stringify(image)}`);if (children !== undefined && children !== null && children !== false) throw new TypeError("ImageNode: takes no children here (a picture on a Node with children: put the ImageNode beside them)");@@ -66,8 +69,12 @@ export function ImageNode({ image, color, flip_x, flip_y, children, fixed, textuconst n = nodeCss("ImageNode", p, ui?.back);const flips = [flip_x && "scaleX(-1)", flip_y && "scaleY(-1)"].filter(Boolean).join(" ");const rendering = RENDERING[useContext(Sampler)];- const css: CSSProperties = { ...n.css, objectFit: "fill", ...(rendering ? { imageRendering: rendering } : {}), ...(flips ? { transform: flips } : {}), ...(color && color.red !== 1 ? { filter: `brightness(${color.red})` } : {}) };- const img = <img src={image} style={css} {...n.attrs} />;+ const look: CSSProperties = { ...(rendering ? { imageRendering: rendering } : {}), ...(flips ? { transform: flips } : {}), ...(color && color.red !== 1 ? { filter: `brightness(${color.red})` } : {}) };+ // Auto: contained, its aspect kept, as bevy_ui draws it; Stretch: no picture size for layout, the picture over the+ // content box as a background+ const img = image_mode === "Stretch"+ ? <div style={{ ...n.css, ...look, backgroundImage: `url("${image}")`, backgroundSize: "100% 100%", backgroundOrigin: "content-box", backgroundClip: "content-box", backgroundRepeat: "no-repeat" }} {...n.attrs} />+ : <img src={image} style={{ ...n.css, objectFit: "contain", ...look }} {...n.attrs} />;const root = fixed ? "fixed" : ui === null;return root ? <div style={root === "fixed" ? { ...VIEWPORT, position: "fixed" } : VIEWPORT}>{img}</div> : img;}@@ -114,7 +121,7 @@ export function ImagePlugin({ default_sampler, children }: { default_sampler?: "// over its background, as Bevy draws the picture), mirrored there, so the flip doesn't turn the label.function SlicedNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, image_mode, ...p }: ImageNodeProps) {if (typeof image !== "string" || image === "") throw new TypeError(`ImageNode: image is a picture file (staticFile("x.png")), got ${JSON.stringify(image)}`);- const sl = image_mode?.Sliced;+ const sl = typeof image_mode === "object" ? image_mode.Sliced : undefined;const b = sl?.border;if (!sl || !b || ![b.left, b.right, b.top, b.bottom].every((v) => Number.isFinite(v) && v >= 0)) throw new TypeError(`ImageNode: image_mode is { Sliced: { border: { left, right, top, bottom } } } (px >= 0), got ${JSON.stringify(image_mode)}`);// a sliced atlas cell: its rect in the layout, which Blitz scales to the sheet as Bevy's atlas UVs arediff --git a/sdk/render/src/bevy3d/ui.tsx b/sdk/render/src/bevy3d/ui.tsxindex 8583557f..1022e88d 100644--- a/sdk/render/src/bevy3d/ui.tsx+++ b/sdk/render/src/bevy3d/ui.tsx@@ -15,6 +15,7 @@ import { gridCss, type GridAutoFlow, type GridPlacement, type GridTrack, type Reimport { shadowCss, transformCss, type BoxShadow, type UiTransform } from "./ui-transform";import { featuresCss } from "./ui-features";import { scrollCss, type IgnoreScroll } from "./ui-scroll";+import { useDebugAttr, type UiDebugOptions } from "./ui-debug";import type { TransformValue } from "./core";import { eulerOf } from "../3d/model";import { useVideoConfig } from "@raea/app/clock";@@ -26,6 +27,10 @@ type Color = Srgba | LinearRgba | string;export interface NodeProps {/** bevy_ecs's Name, as a Scrollbar's target names its scroller (the element's id) */name?: string;+ /** UiDebugOptions: this node's debug overlay, in place of the GlobalUiDebugOptions it's in */+ ui_debug?: UiDebugOptions;+ /** the index its debug outline is coloured by (Hsla::sequential_dispersed), as Bevy colours it by its entity's */+ debug_color_index?: number;display?: (typeof DISPLAY)[number];box_sizing?: "BorderBox" | "ContentBox";position_type?: (typeof POSITION_TYPE)[number];@@ -180,6 +185,8 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop, scale = 1):s.overflowY = o.y.toLowerCase();}if (p.name !== undefined) attrs.id = p.name;+ const dbg = useDebugAttr(who, p.ui_debug, p.debug_color_index, useContext(UiScaleCx));+ if (dbg) attrs["data-raea-bevy-debug"] = dbg;scrollCss(who, p, s, attrs, scale);const m = p.overflow_clip_margin;if (m !== undefined) {diff --git a/sdk/skills/raea/reference/sdk.md b/sdk/skills/raea/reference/sdk.mdindex 75e1c409..58467445 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`, `FontWidth`, `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`+`AbsoluteFill`, `AngularColorStop`, `BorderRadius`, `BoxShadow`, `ColorStop`, `ConicGradient`, `CornerRadius`, `FontFeatureTag`, `FontSource`, `FontVariationTag`, `FontWidth`, `GhostNode`, `GlobalUiDebugOptions`, `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/vendor/blitz-paint/src/render.rs b/vendor/blitz-paint/src/render.rsindex b3031b05..3e3691d0 100644--- a/vendor/blitz-paint/src/render.rs+++ b/vendor/blitz-paint/src/render.rs@@ -1,4 +1,5 @@mod background;+mod bevy_debug;mod border;mod border_image;mod box_shadow;@@ -142,6 +143,8 @@ pub struct BlitzDomPainter<'dom, 'a> {pub(crate) plane: Cell<Option<NodeId>>,/// raea: the in-flow block being drawn in one of its parent's paint phases, not whole (RAEA_PAGE_PAINT_PHASES)pub(crate) split: Cell<Option<(NodeId, Phase)>>,+ /// raea: bevy_ui debug outlines recorded as their elements are drawn, drawn over the document (bevy_debug.rs)+ pub(crate) bevy_debug: RefCell<Vec<bevy_debug::DebugOutline>>,}/// raea: the steps of CSS 2.1 Appendix E an element paints its descendants in: the in-flow blocks' backgrounds and@@ -493,6 +496,7 @@ impl<'dom, 'a> BlitzDomPainter<'dom, 'a> {rooting: Cell::new(None),plane: Cell::new(None),split: Cell::new(None),+ bevy_debug: RefCell::new(Vec::new()),}}@@ -571,6 +575,7 @@ impl<'dom, 'a> BlitzDomPainter<'dom, 'a> {}),viewport_clip_rect,);+ bevy_debug::draw(scene, &self.bevy_debug.take());// Render debug overlayif self.dom.devtools().highlight_hover {@@ -1005,6 +1010,9 @@ impl<'dom, 'a> BlitzDomPainter<'dom, 'a> {// Apply CSS transform property (where transforms are 2d)let mut cx = self.element_cx(node, *node.final_layout(), transform, custom_widget_scene);+ if let Some(o) = node.attr(blitz_dom::LocalName::from("data-raea-bevy-debug")).and_then(|a| bevy_debug::outline(a, &cx.frame, cx.transform, clip_rect, self.scale)) {+ self.bevy_debug.borrow_mut().push(o);+ }if hidden_face {if blitz_dom::preserves_3d(&styles) {cx.draw_children(scene, cx.transform, clip_rect);diff --git a/vendor/blitz-paint/src/render/bevy_debug.rs b/vendor/blitz-paint/src/render/bevy_debug.rsnew file mode 100644index 00000000..8c99f450--- /dev/null+++ b/vendor/blitz-paint/src/render/bevy_debug.rs@@ -0,0 +1,67 @@+//! raea: bevy_ui's debug overlay (UiDebugOptions, GlobalUiDebugOptions; sdk/render's `ui_debug`). An element marked+//! `data-raea-bevy-debug="width r g b a boxes clipped"` has outlines drawn after the whole document, above every UI+//! node as bevy_ui_render's extract_debug_overlay keeps them: a ring `width` device px thick inside its border box+//! (`b`), padding box (`p`) and content box (`c`), following its corners' radii on the border and padding boxes, in+//! the sRGB colour given, cut by the clip its ancestors' overflow gives it unless `clipped` is 1 (show_clipped).++use kurbo::{Affine, Rect, RoundedRect, RoundedRectRadii, Shape};+use peniko::{Color, Fill};++use crate::kurbo_css::CssBox;+use anyrender::PaintScene;++/// One element's outlines, as recorded while the document was drawn.+pub(crate) struct DebugOutline {+ transform: Affine,+ clip: Option<Rect>,+ rings: Vec<(Rect, RoundedRectRadii)>,+ width: f64,+ color: Color,+}++/// The element's outlines from its `data-raea-bevy-debug` value, or None when it isn't one.+pub(crate) fn outline(attr: &str, frame: &CssBox, transform: Affine, clip: Rect, scale: f64) -> Option<DebugOutline> {+ let mut it = attr.split_whitespace();+ let mut num = || it.next()?.parse::<f64>().ok();+ let (width, r, g, b, a) = (num()? * scale, num()?, num()?, num()?, num()?);+ let boxes = it.next()?;+ let unclipped = it.next() == Some("1");+ let radii = &frame.border_radii;+ let outer = RoundedRectRadii::new(radii.top_left.x, radii.top_right.x, radii.bottom_right.x, radii.bottom_left.x);+ let bw = &frame.border_width;+ let inner = RoundedRectRadii::new(+ (radii.top_left.x - bw.x0.max(bw.y0)).max(0.0),+ (radii.top_right.x - bw.x1.max(bw.y0)).max(0.0),+ (radii.bottom_right.x - bw.x1.max(bw.y1)).max(0.0),+ (radii.bottom_left.x - bw.x0.max(bw.y1)).max(0.0),+ );+ let mut rings = Vec::new();+ for (k, rect, radii) in [('b', frame.border_box, outer), ('p', frame.padding_box, inner), ('c', frame.content_box, RoundedRectRadii::from_single_radius(0.0))] {+ if boxes.contains(k) && rect.width() > 0.0 && rect.height() > 0.0 {+ rings.push((rect, radii));+ }+ }+ let color = Color::new([r as f32, g as f32, b as f32, a as f32]);+ Some(DebugOutline { transform, clip: (!unclipped).then_some(clip), rings, width, color })+}++/// Draw the recorded outlines, in the order their elements were drawn, over everything.+pub(crate) fn draw(scene: &mut impl PaintScene, outlines: &[DebugOutline]) {+ for o in outlines {+ if let Some(clip) = o.clip {+ scene.push_clip_layer(Fill::NonZero, Affine::IDENTITY, &clip);+ }+ for (rect, radii) in &o.rings {+ // a ring `width` thick inside the box: the box less the box inset by `width`, its radii shrunk as a border's+ let w = o.width.min(rect.width() / 2.0).min(rect.height() / 2.0);+ let shrink = |r: f64| (r - w).max(0.0);+ let inner_radii = RoundedRectRadii::new(shrink(radii.top_left), shrink(radii.top_right), shrink(radii.bottom_right), shrink(radii.bottom_left));+ let mut path = RoundedRect::from_rect(*rect, *radii).to_path(0.1);+ path.extend(RoundedRect::from_rect(rect.inset(-w), inner_radii).to_path(0.1));+ scene.fill(Fill::EvenOdd, o.transform, o.color, None, &path);+ }+ if o.clip.is_some() {+ scene.pop_layer();+ }+ }+}