Skip to content

armgit / raea

Public Imported from GitHub
0

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.

FC0a: outline-offset and Bevy's outline corners in Blitz, corners resolved as Bevy's (CornerRadius, BorderRadius.px, clamped to the node), BorderColor per side, ImageNode in its own file; ui/styling/borders ported

shinyobjectze3df1da170f9
diff --git a/bench/bevy-parity/examples.list b/bench/bevy-parity/examples.list
index 3fce3674..0c23e2d3 100644
--- a/bench/bevy-parity/examples.list
+++ b/bench/bevy-parity/examples.list
@@ -64,3 +64,4 @@ ui/images/ui_texture_atlas_slice
ui/images/ui_texture_slice_flip_and_tile
ui/widgets/button
ui/text/letter_spacing
+ui/styling/borders
diff --git a/bench/bevy-parity/runs.tsv b/bench/bevy-parity/runs.tsv
index 757fd46e..18a11640 100644
--- a/bench/bevy-parity/runs.tsv
+++ b/bench/bevy-parity/runs.tsv
@@ -63,3 +63,4 @@ ui/images/ui_texture_slice_flip_and_tile - 10
ui/images/ui_texture_atlas_slice - 10
ui/widgets/button - 10
ui/text/letter_spacing - 10
+ui/styling/borders - 10
diff --git a/docs/bevy-parity.md b/docs/bevy-parity.md
index e4ed7e7b..52abdf75 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 and
frame time at most 1.25x the example's). Wall time is one machine's, measured in the same run.
-Examples: **438**, ported **64**, passing **61**, excluded **16** (docs/bevy-parity/excluded.tsv), left **361**.
+Examples: **438**, ported **65**, passing **62**, excluded **16** (docs/bevy-parity/excluded.tsv), left **360**.
raea's frame ms is its update's plus the time React takes to step a frame for its 3D (step), which the example
doesn't pay.
@@ -76,50 +76,51 @@ doesn't pay.
| 3d/mesh_ray_cast | 900 | 0.999608 | 1 | 1 / 1 | 447 / 44258 | 6 / 8 | 2 / 2 | 16.664 / 4.882 = 3.464 + 1.418 | yes | |
| 3d/lightmaps | 10 | 1.000000 | 0 | 6 / 6 | 453 / 506 | 11 / 13 | 6 / 10 | 16.538 / 1.727 = 1.5 + 0.227 | yes | |
| 3d/lightmaps | 5 | 1.000000 | 0 | 6 / 6 | 453 / 506 | 11 / 13 | 6 / 10 | 58.916 / 2.25 = 2.05 + 0.200 | yes | |
-| 2d/mesh2d | 10 | 0.999348 | 0 | 0 / 0 | 441 / 494 | 6 / 8 | 1 / 1 | 30.072 / 1.6 = 1.445 + 0.155 | yes | |
-| 2d/sprite | 10 | 0.998326 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 29.165 / 1.461 = 1.297 + 0.164 | yes | |
-| 2d/sprite_flipping | 10 | 0.998326 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 28.607 / 1.252 = 1.097 + 0.155 | yes | |
-| 2d/move_sprite | 120 | 0.998270 | 9 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 1.384 / 0.811 = 0.746 + 0.065 | yes | |
-| 2d/move_sprite | 30 | 0.998261 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 10.949 / 1.061 = 0.926 + 0.135 | yes | |
-| 2d/transparency_2d | 10 | 0.997674 | 5 | 0 / 0 | 443 / 496 | 5 / 7 | 1 / 1 | 29.126 / 1.236 = 1.1 + 0.136 | yes | |
-| 2d/sprite_sheet | 30 | 0.998820 | 5 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 11.109 / 1.063 = 0.915 + 0.148 | yes | |
-| 2d/sprite_sheet | 60 | 0.999054 | 5 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 1.304 / 0.941 = 0.843 + 0.098 | yes | |
-| 2d/sprite_animation | 12 | 0.997217 | 9 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 25.377 / 1.257 = 1.026 + 0.231 | yes | |
-| 2d/sprite_animation | 30 | 0.997017 | 8 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 1.399 / 1.001 = 0.859 + 0.142 | yes | |
-| 2d/sprite_animation | 60 | 0.997099 | 8 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 1.543 / 1.186 = 1.065 + 0.121 | yes | |
-| 2d/sprite_tile | 30 | 0.998633 | 7 | 0 / 0 | 442 / 494 | 5 / 7 | 1 / 1 | 12.123 / 1.287 = 1.116 + 0.171 | yes | |
-| 2d/sprite_tile | 300 | 0.992213 | 7 | 0 / 0 | 442 / 494 | 5 / 7 | 1 / 1 | 1.316 / 1.026 = 0.956 + 0.070 | yes | |
-| 2d/rotate_to_cursor | 10 | 0.999835 | 3 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 2.096 / 1.348 = 1.203 + 0.145 | yes | |
-| 2d/rotate_to_cursor | 5 | 0.999835 | 3 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 56.874 / 2.461 = 2.244 + 0.217 | yes | |
-| 2d/mesh2d_alpha_mode | 10 | 0.989355 | 8 | 0 / 0 | 446 / 499 | 6 / 13 | 1 / 1 | 2.25 / 1.602 = 1.447 + 0.155 | yes | |
-| 2d/mesh2d_alpha_mode | 5 | 0.989355 | 8 | 0 / 0 | 446 / 499 | 6 / 13 | 1 / 1 | 57.079 / 3.432 = 3.265 + 0.167 | yes | |
-| ui/styling/transparency_ui | 10 | 0.999700 | 3 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 1.801 / 1.117 = 0.99 + 0.127 | yes | |
-| ui/styling/transparency_ui | 5 | 0.999700 | 3 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 55.663 / 1.962 = 1.795 + 0.167 | yes | |
-| ui/layout/fixed_node | 10 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 1.666 / 1.148 = 1.003 + 0.145 | yes | |
-| ui/layout/fixed_node | 5 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 50.751 / 1.987 = 1.787 + 0.200 | yes | |
-| ui/images/image_node | 10 | 0.999893 | 1 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 2.178 / 1.408 = 1.217 + 0.191 | yes | |
-| ui/images/image_node | 5 | 0.999893 | 1 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 55.648 / 2.548 = 2.315 + 0.233 | yes | |
-| ui/text/font_weights | 10 | 0.990279 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 2.27 / 1.213 = 1.086 + 0.127 | yes | |
-| ui/text/font_weights | 5 | 0.990279 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 56.44 / 2.22 = 2.07 + 0.150 | yes | |
-| ui/text/font_variations | 10 | 0.992845 | 21 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 2.394 / 1.68 = 1.525 + 0.155 | yes | |
-| ui/text/font_variations | 5 | 0.992845 | 21 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 56.054 / 2.186 = 2.019 + 0.167 | yes | |
-| ui/text/text_background_colors | 10 | 0.997735 | 8 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 1.979 / 1.211 = 1.093 + 0.118 | yes | |
-| ui/text/text_background_colors | 5 | 0.997735 | 8 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 58.344 / 1.948 = 1.781 + 0.167 | yes | |
-| ui/text/strikethrough_and_underline | 10 | 0.990152 | 14 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 1.742 / 1.301 = 1.056 + 0.245 | yes | |
-| ui/text/strikethrough_and_underline | 5 | 0.990152 | 14 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 53.721 / 1.978 = 1.811 + 0.167 | yes | |
-| ui/scroll_and_overflow/overflow | 10 | 0.998143 | 5 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 1.842 / 1.276 = 1.094 + 0.182 | yes | |
-| ui/scroll_and_overflow/overflow | 5 | 0.998143 | 5 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 48.557 / 2.431 = 2.098 + 0.333 | yes | |
-| ui/images/ui_texture_atlas | 10 | 0.999601 | 7 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 1.701 / 1.341 = 1.223 + 0.118 | yes | |
-| ui/images/ui_texture_atlas | 5 | 0.999601 | 7 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 53.42 / 1.969 = 1.802 + 0.167 | yes | |
-| 2d/mesh2d_vertex_color_texture | 10 | 0.998651 | 6 | 0 / 0 | 442 / 495 | 6 / 9 | 1 / 1 | 30.477 / 1.149 = 0.985 + 0.164 | yes | |
-| 2d/mesh2d_repeated_texture | 10 | 0.991205 | 17 | 0 / 0 | 437 / 496 | 8 / 10 | 1 / 1 | 22.339 / 1.297 = 1.106 + 0.191 | yes | |
-| ui/layout/flex_layout | 10 | 0.990851 | 8 | 0 / 0 | 602 / 492 | 5 / 7 | 1 / 1 | 28.623 / 1.026 = 0.962 + 0.064 | yes | |
-| ui/scroll_and_overflow/overflow_clip_margin | 10 | 0.996801 | 9 | 0 / 0 | 465 / 492 | 5 / 7 | 1 / 1 | 29.665 / 1.075 = 0.866 + 0.209 | yes | |
-| ui/images/ui_texture_slice | 10 | 0.998957 | 8 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 29.763 / 1.1 = 0.964 + 0.136 | yes | |
-| ui/images/ui_texture_slice_flip_and_tile | 10 | 1.000000 | 0 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 28.635 / 1.035 = 0.853 + 0.182 | yes | |
-| ui/images/ui_texture_atlas_slice | 10 | 0.990791 | 17 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 29.482 / 1.293 = 1.166 + 0.127 | yes | |
-| ui/widgets/button | 10 | 0.999600 | 8 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 29.379 / 1.391 = 1.246 + 0.145 | yes | |
-| ui/text/letter_spacing | 10 | 0.995902 | 13 | 0 / 0 | 455 / 492 | 5 / 7 | 1 / 1 | 30.51 / 1.007 = 0.88 + 0.127 | yes | |
+| 2d/mesh2d | 10 | 0.999348 | 0 | 0 / 0 | 441 / 494 | 6 / 8 | 1 / 1 | 29.381 / 1.245 = 1.109 + 0.136 | yes | |
+| 2d/sprite | 10 | 0.998326 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 28.87 / 1.369 = 1.214 + 0.155 | yes | |
+| 2d/sprite_flipping | 10 | 0.998326 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 29.453 / 1.18 = 1.016 + 0.164 | yes | |
+| 2d/move_sprite | 120 | 0.998270 | 9 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 1.301 / 0.851 = 0.779 + 0.072 | yes | |
+| 2d/move_sprite | 30 | 0.998261 | 8 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 11.019 / 1.025 = 0.886 + 0.139 | yes | |
+| 2d/transparency_2d | 10 | 0.997674 | 5 | 0 / 0 | 443 / 496 | 5 / 7 | 1 / 1 | 28.586 / 1.61 = 1.437 + 0.173 | yes | |
+| 2d/sprite_sheet | 30 | 0.998820 | 5 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 12.358 / 1.161 = 1.009 + 0.152 | yes | |
+| 2d/sprite_sheet | 60 | 0.999054 | 5 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 1.684 / 0.954 = 0.846 + 0.108 | yes | |
+| 2d/sprite_animation | 12 | 0.997217 | 9 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 26.286 / 1.316 = 1.078 + 0.238 | yes | |
+| 2d/sprite_animation | 30 | 0.997017 | 8 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 1.516 / 1.182 = 1.014 + 0.168 | yes | |
+| 2d/sprite_animation | 60 | 0.997099 | 8 | 0 / 0 | 443 / 495 | 5 / 7 | 1 / 1 | 1.603 / 1.127 = 1.022 + 0.105 | yes | |
+| 2d/sprite_tile | 30 | 0.998633 | 7 | 0 / 0 | 442 / 494 | 5 / 7 | 1 / 1 | 11.517 / 1.095 = 0.869 + 0.226 | yes | |
+| 2d/sprite_tile | 300 | 0.992213 | 7 | 0 / 0 | 442 / 494 | 5 / 7 | 1 / 1 | 1.111 / 0.944 = 0.886 + 0.058 | yes | |
+| 2d/rotate_to_cursor | 10 | 0.999835 | 3 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 1.72 / 1.236 = 1.063 + 0.173 | yes | |
+| 2d/rotate_to_cursor | 5 | 0.999835 | 3 | 0 / 0 | 441 / 494 | 5 / 7 | 1 / 1 | 54.139 / 2.251 = 2.084 + 0.167 | yes | |
+| 2d/mesh2d_alpha_mode | 10 | 0.989355 | 8 | 0 / 0 | 446 / 499 | 6 / 13 | 1 / 1 | 1.826 / 1.174 = 1.038 + 0.136 | yes | |
+| 2d/mesh2d_alpha_mode | 5 | 0.989355 | 8 | 0 / 0 | 446 / 499 | 6 / 13 | 1 / 1 | 53.141 / 2.953 = 2.77 + 0.183 | yes | |
+| ui/styling/transparency_ui | 10 | 0.999700 | 3 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 1.947 / 1.235 = 1.099 + 0.136 | yes | |
+| ui/styling/transparency_ui | 5 | 0.999700 | 3 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 51.898 / 2.245 = 2.062 + 0.183 | yes | |
+| ui/layout/fixed_node | 10 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 1.625 / 1.025 = 0.889 + 0.136 | yes | |
+| ui/layout/fixed_node | 5 | 1.000000 | 0 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 52.191 / 1.919 = 1.736 + 0.183 | yes | |
+| ui/images/image_node | 10 | 0.999893 | 1 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 1.803 / 1.124 = 0.997 + 0.127 | yes | |
+| ui/images/image_node | 5 | 0.999893 | 1 | 0 / 0 | 442 / 492 | 5 / 7 | 1 / 1 | 51.783 / 2.207 = 2.007 + 0.200 | yes | |
+| ui/text/font_weights | 10 | 0.990279 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 2.095 / 1.077 = 0.959 + 0.118 | yes | |
+| ui/text/font_weights | 5 | 0.990279 | 17 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 53.705 / 1.984 = 1.834 + 0.150 | yes | |
+| ui/text/font_variations | 10 | 0.992845 | 21 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 2.342 / 1.082 = 0.946 + 0.136 | yes | |
+| ui/text/font_variations | 5 | 0.992845 | 21 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 58.165 / 2.193 = 2.01 + 0.183 | yes | |
+| ui/text/text_background_colors | 10 | 0.997735 | 8 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 1.959 / 0.987 = 0.878 + 0.109 | yes | |
+| ui/text/text_background_colors | 5 | 0.997735 | 8 | 0 / 0 | 505 / 492 | 5 / 7 | 1 / 1 | 52.065 / 1.985 = 1.818 + 0.167 | yes | |
+| ui/text/strikethrough_and_underline | 10 | 0.990152 | 14 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 1.971 / 1.07 = 0.952 + 0.118 | yes | |
+| ui/text/strikethrough_and_underline | 5 | 0.990152 | 14 | 0 / 0 | 454 / 492 | 5 / 7 | 1 / 1 | 53.746 / 2.002 = 1.835 + 0.167 | yes | |
+| ui/scroll_and_overflow/overflow | 10 | 0.998143 | 5 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 1.844 / 1.185 = 1.003 + 0.182 | yes | |
+| ui/scroll_and_overflow/overflow | 5 | 0.998143 | 5 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 51.909 / 2.005 = 1.872 + 0.133 | yes | |
+| ui/images/ui_texture_atlas | 10 | 0.999601 | 7 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 1.911 / 1.062 = 0.944 + 0.118 | yes | |
+| ui/images/ui_texture_atlas | 5 | 0.999601 | 7 | 0 / 0 | 445 / 492 | 5 / 7 | 1 / 1 | 51.472 / 1.924 = 1.741 + 0.183 | yes | |
+| 2d/mesh2d_vertex_color_texture | 10 | 0.998651 | 6 | 0 / 0 | 442 / 495 | 6 / 9 | 1 / 1 | 30.479 / 1.42 = 1.293 + 0.127 | yes | |
+| 2d/mesh2d_repeated_texture | 10 | 0.991205 | 17 | 0 / 0 | 437 / 496 | 8 / 10 | 1 / 1 | 22.557 / 1.214 = 1.005 + 0.209 | yes | |
+| ui/layout/flex_layout | 10 | 0.990851 | 8 | 0 / 0 | 602 / 492 | 5 / 7 | 1 / 1 | 33.526 / 1.161 = 1.079 + 0.082 | yes | |
+| ui/scroll_and_overflow/overflow_clip_margin | 10 | 0.996801 | 9 | 0 / 0 | 465 / 492 | 5 / 7 | 1 / 1 | 29.516 / 1.211 = 1.029 + 0.182 | yes | |
+| ui/images/ui_texture_slice | 10 | 0.998957 | 8 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 28.996 / 1.018 = 0.863 + 0.155 | yes | |
+| ui/images/ui_texture_slice_flip_and_tile | 10 | 1.000000 | 0 | 0 / 0 | 461 / 492 | 5 / 7 | 1 / 1 | 30.548 / 1.22 = 1.038 + 0.182 | yes | |
+| ui/images/ui_texture_atlas_slice | 10 | 0.990791 | 17 | 0 / 0 | 447 / 492 | 5 / 7 | 1 / 1 | 31.271 / 2.003 = 1.858 + 0.145 | yes | |
+| ui/widgets/button | 10 | 0.999600 | 8 | 0 / 0 | 444 / 492 | 5 / 7 | 1 / 1 | 35.41 / 2.388 = 2.206 + 0.182 | yes | |
+| ui/text/letter_spacing | 10 | 0.995902 | 13 | 0 / 0 | 455 / 492 | 5 / 7 | 1 / 1 | 33.351 / 1.215 = 1.088 + 0.127 | yes | |
+| ui/styling/borders | 10 | 0.991738 | 9 | 0 / 0 | 591 / 492 | 5 / 7 | 1 / 1 | 30.134 / 0.944 = 0.871 + 0.073 | yes | |
## Excluded
diff --git a/docs/bevy-parity/results.jsonl b/docs/bevy-parity/results.jsonl
index 5212bc37..ea79c301 100644
--- a/docs/bevy-parity/results.jsonl
+++ b/docs/bevy-parity/results.jsonl
@@ -63,47 +63,48 @@
{"example":"3d/mesh_ray_cast","frame":900,"ssim":0.999608,"tile":1,"bevy":{"batch_keys":1,"entities":447,"extents":["0.5000 0.0000 0.5000"],"frame":900,"frame_ms":16.664,"materials":2,"mesh_entities":6,"meshes":6,"other_material":0,"visible":6},"raea":{"frame":907,"entities":44258,"mesh_entities":6,"visible":6,"meshes":8,"materials":2,"batch_keys":1,"other_material":0,"extents":["0.5000 0.0000 0.5000"],"frame_ms":3.464,"step_ms":1.418,"cost_ms":4.882},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
{"example":"3d/lightmaps","frame":10,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":6,"entities":453,"extents":["0.0001 274.4000 279.6000","102.6464 82.5000 102.6464","103.2390 165.0000 103.2390","278.0000 274.4000 279.6001","3.2000 274.4000 279.6000","65.0000 0.0000 52.5000"],"frame":10,"frame_ms":16.538,"materials":6,"mesh_entities":6,"meshes":11,"other_material":0,"visible":6},"raea":{"frame":19,"entities":506,"mesh_entities":6,"visible":6,"meshes":13,"materials":10,"batch_keys":6,"other_material":0,"extents":["0.0001 274.4000 279.6000","102.6464 82.5000 102.6464","103.2390 165.0000 103.2390","278.0000 274.4000 279.6001","3.2000 274.4000 279.6000","65.0000 0.0000 52.5000"],"frame_ms":1.5,"step_ms":0.227,"cost_ms":1.727},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
{"example":"3d/lightmaps","frame":5,"ssim":1.000000,"tile":0,"bevy":{"batch_keys":6,"entities":453,"extents":["0.0001 274.4000 279.6000","102.6464 82.5000 102.6464","103.2390 165.0000 103.2390","278.0000 274.4000 279.6001","3.2000 274.4000 279.6000","65.0000 0.0000 52.5000"],"frame":5,"frame_ms":58.916,"materials":6,"mesh_entities":6,"meshes":11,"other_material":0,"visible":6},"raea":{"frame":14,"entities":506,"mesh_entities":6,"visible":6,"meshes":13,"materials":10,"batch_keys":6,"other_material":0,"extents":["0.0001 274.4000 279.6000","102.6464 82.5000 102.6464","103.2390 165.0000 103.2390","278.0000 274.4000 279.6001","3.2000 274.4000 279.6000","65.0000 0.0000 52.5000"],"frame_ms":2.05,"step_ms":0.200,"cost_ms":2.25},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/mesh2d","frame":10,"ssim":0.999348,"tile":0,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":30.072,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":8,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.445,"step_ms":0.155,"cost_ms":1.6},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite","frame":10,"ssim":0.998326,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":29.165,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.297,"step_ms":0.164,"cost_ms":1.461},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_flipping","frame":10,"ssim":0.998326,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":28.607,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.097,"step_ms":0.155,"cost_ms":1.252},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/move_sprite","frame":120,"ssim":0.998270,"tile":9,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":120,"frame_ms":1.384,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":127,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.746,"step_ms":0.065,"cost_ms":0.811},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/move_sprite","frame":30,"ssim":0.998261,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":30,"frame_ms":10.949,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.926,"step_ms":0.135,"cost_ms":1.061},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/transparency_2d","frame":10,"ssim":0.997674,"tile":5,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":10,"frame_ms":29.126,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":496,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.1,"step_ms":0.136,"cost_ms":1.236},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_sheet","frame":30,"ssim":0.998820,"tile":5,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":30,"frame_ms":11.109,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.915,"step_ms":0.148,"cost_ms":1.063},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_sheet","frame":60,"ssim":0.999054,"tile":5,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":60,"frame_ms":1.304,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":67,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.843,"step_ms":0.098,"cost_ms":0.941},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_animation","frame":12,"ssim":0.997217,"tile":9,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":12,"frame_ms":25.377,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":19,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.026,"step_ms":0.231,"cost_ms":1.257},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_animation","frame":30,"ssim":0.997017,"tile":8,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":30,"frame_ms":1.399,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.859,"step_ms":0.142,"cost_ms":1.001},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_animation","frame":60,"ssim":0.997099,"tile":8,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":60,"frame_ms":1.543,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":67,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.065,"step_ms":0.121,"cost_ms":1.186},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_tile","frame":30,"ssim":0.998633,"tile":7,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":30,"frame_ms":12.123,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.116,"step_ms":0.171,"cost_ms":1.287},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/sprite_tile","frame":300,"ssim":0.992213,"tile":7,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":300,"frame_ms":1.316,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":307,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.956,"step_ms":0.070,"cost_ms":1.026},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/rotate_to_cursor","frame":10,"ssim":0.999835,"tile":3,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":2.096,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.203,"step_ms":0.145,"cost_ms":1.348},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/rotate_to_cursor","frame":5,"ssim":0.999835,"tile":3,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":5,"frame_ms":56.874,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.244,"step_ms":0.217,"cost_ms":2.461},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/mesh2d_alpha_mode","frame":10,"ssim":0.989355,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":2.25,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":17,"entities":499,"mesh_entities":0,"visible":0,"meshes":13,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.447,"step_ms":0.155,"cost_ms":1.602},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"2d/mesh2d_alpha_mode","frame":5,"ssim":0.989355,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":5,"frame_ms":57.079,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":12,"entities":499,"mesh_entities":0,"visible":0,"meshes":13,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":3.265,"step_ms":0.167,"cost_ms":3.432},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/styling/transparency_ui","frame":10,"ssim":0.999700,"tile":3,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":1.801,"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.99,"step_ms":0.127,"cost_ms":1.117},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/styling/transparency_ui","frame":5,"ssim":0.999700,"tile":3,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":55.663,"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.795,"step_ms":0.167,"cost_ms":1.962},"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.666,"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.003,"step_ms":0.145,"cost_ms":1.148},"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":50.751,"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.787,"step_ms":0.200,"cost_ms":1.987},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/image_node","frame":10,"ssim":0.999893,"tile":1,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":2.178,"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.217,"step_ms":0.191,"cost_ms":1.408},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/image_node","frame":5,"ssim":0.999893,"tile":1,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":5,"frame_ms":55.648,"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.315,"step_ms":0.233,"cost_ms":2.548},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/font_weights","frame":10,"ssim":0.990279,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":2.27,"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.086,"step_ms":0.127,"cost_ms":1.213},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/font_weights","frame":5,"ssim":0.990279,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":5,"frame_ms":56.44,"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.07,"step_ms":0.150,"cost_ms":2.22},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/font_variations","frame":10,"ssim":0.992845,"tile":21,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":10,"frame_ms":2.394,"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.525,"step_ms":0.155,"cost_ms":1.68},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/font_variations","frame":5,"ssim":0.992845,"tile":21,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":5,"frame_ms":56.054,"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.019,"step_ms":0.167,"cost_ms":2.186},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/text_background_colors","frame":10,"ssim":0.997735,"tile":8,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":10,"frame_ms":1.979,"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":0.118,"cost_ms":1.211},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/text_background_colors","frame":5,"ssim":0.997735,"tile":8,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":5,"frame_ms":58.344,"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.781,"step_ms":0.167,"cost_ms":1.948},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/strikethrough_and_underline","frame":10,"ssim":0.990152,"tile":14,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":1.742,"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.056,"step_ms":0.245,"cost_ms":1.301},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/strikethrough_and_underline","frame":5,"ssim":0.990152,"tile":14,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":5,"frame_ms":53.721,"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.811,"step_ms":0.167,"cost_ms":1.978},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/scroll_and_overflow/overflow","frame":10,"ssim":0.998143,"tile":5,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":10,"frame_ms":1.842,"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.094,"step_ms":0.182,"cost_ms":1.276},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/scroll_and_overflow/overflow","frame":5,"ssim":0.998143,"tile":5,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":5,"frame_ms":48.557,"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.098,"step_ms":0.333,"cost_ms":2.431},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/ui_texture_atlas","frame":10,"ssim":0.999601,"tile":7,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":1.701,"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.223,"step_ms":0.118,"cost_ms":1.341},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/ui_texture_atlas","frame":5,"ssim":0.999601,"tile":7,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":53.42,"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.802,"step_ms":0.167,"cost_ms":1.969},"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":30.477,"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":0.985,"step_ms":0.164,"cost_ms":1.149},"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":22.339,"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.106,"step_ms":0.191,"cost_ms":1.297},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/layout/flex_layout","frame":10,"ssim":0.990851,"tile":8,"bevy":{"batch_keys":0,"entities":602,"extents":[],"frame":10,"frame_ms":28.623,"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.962,"step_ms":0.064,"cost_ms":1.026},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/scroll_and_overflow/overflow_clip_margin","frame":10,"ssim":0.996801,"tile":9,"bevy":{"batch_keys":0,"entities":465,"extents":[],"frame":10,"frame_ms":29.665,"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.866,"step_ms":0.209,"cost_ms":1.075},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/ui_texture_slice","frame":10,"ssim":0.998957,"tile":8,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":29.763,"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.964,"step_ms":0.136,"cost_ms":1.1},"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":28.635,"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.853,"step_ms":0.182,"cost_ms":1.035},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/images/ui_texture_atlas_slice","frame":10,"ssim":0.990791,"tile":17,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":29.482,"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.166,"step_ms":0.127,"cost_ms":1.293},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/widgets/button","frame":10,"ssim":0.999600,"tile":8,"bevy":{"batch_keys":0,"entities":444,"extents":[],"frame":10,"frame_ms":29.379,"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.246,"step_ms":0.145,"cost_ms":1.391},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
-{"example":"ui/text/letter_spacing","frame":10,"ssim":0.995902,"tile":13,"bevy":{"batch_keys":0,"entities":455,"extents":[],"frame":10,"frame_ms":30.51,"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.88,"step_ms":0.127,"cost_ms":1.007},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/mesh2d","frame":10,"ssim":0.999348,"tile":0,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":29.381,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":8,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.109,"step_ms":0.136,"cost_ms":1.245},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite","frame":10,"ssim":0.998326,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":28.87,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.214,"step_ms":0.155,"cost_ms":1.369},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_flipping","frame":10,"ssim":0.998326,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":29.453,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.016,"step_ms":0.164,"cost_ms":1.18},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/move_sprite","frame":120,"ssim":0.998270,"tile":9,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":120,"frame_ms":1.301,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":127,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.779,"step_ms":0.072,"cost_ms":0.851},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/move_sprite","frame":30,"ssim":0.998261,"tile":8,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":30,"frame_ms":11.019,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.886,"step_ms":0.139,"cost_ms":1.025},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/transparency_2d","frame":10,"ssim":0.997674,"tile":5,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":10,"frame_ms":28.586,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":496,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.437,"step_ms":0.173,"cost_ms":1.61},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_sheet","frame":30,"ssim":0.998820,"tile":5,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":30,"frame_ms":12.358,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.009,"step_ms":0.152,"cost_ms":1.161},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_sheet","frame":60,"ssim":0.999054,"tile":5,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":60,"frame_ms":1.684,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":67,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.846,"step_ms":0.108,"cost_ms":0.954},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_animation","frame":12,"ssim":0.997217,"tile":9,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":12,"frame_ms":26.286,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":19,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.078,"step_ms":0.238,"cost_ms":1.316},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_animation","frame":30,"ssim":0.997017,"tile":8,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":30,"frame_ms":1.516,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.014,"step_ms":0.168,"cost_ms":1.182},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_animation","frame":60,"ssim":0.997099,"tile":8,"bevy":{"batch_keys":0,"entities":443,"extents":[],"frame":60,"frame_ms":1.603,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":67,"entities":495,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.022,"step_ms":0.105,"cost_ms":1.127},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_tile","frame":30,"ssim":0.998633,"tile":7,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":30,"frame_ms":11.517,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":37,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.869,"step_ms":0.226,"cost_ms":1.095},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/sprite_tile","frame":300,"ssim":0.992213,"tile":7,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":300,"frame_ms":1.111,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":307,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":0.886,"step_ms":0.058,"cost_ms":0.944},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/rotate_to_cursor","frame":10,"ssim":0.999835,"tile":3,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":10,"frame_ms":1.72,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.063,"step_ms":0.173,"cost_ms":1.236},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/rotate_to_cursor","frame":5,"ssim":0.999835,"tile":3,"bevy":{"batch_keys":0,"entities":441,"extents":[],"frame":5,"frame_ms":54.139,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":12,"entities":494,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.084,"step_ms":0.167,"cost_ms":2.251},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/mesh2d_alpha_mode","frame":10,"ssim":0.989355,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":1.826,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":17,"entities":499,"mesh_entities":0,"visible":0,"meshes":13,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.038,"step_ms":0.136,"cost_ms":1.174},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"2d/mesh2d_alpha_mode","frame":5,"ssim":0.989355,"tile":8,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":5,"frame_ms":53.141,"materials":1,"mesh_entities":0,"meshes":6,"other_material":0,"visible":0},"raea":{"frame":12,"entities":499,"mesh_entities":0,"visible":0,"meshes":13,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.77,"step_ms":0.183,"cost_ms":2.953},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/styling/transparency_ui","frame":10,"ssim":0.999700,"tile":3,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":1.947,"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.099,"step_ms":0.136,"cost_ms":1.235},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/styling/transparency_ui","frame":5,"ssim":0.999700,"tile":3,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":51.898,"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.062,"step_ms":0.183,"cost_ms":2.245},"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.625,"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.889,"step_ms":0.136,"cost_ms":1.025},"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":52.191,"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.736,"step_ms":0.183,"cost_ms":1.919},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/image_node","frame":10,"ssim":0.999893,"tile":1,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":10,"frame_ms":1.803,"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.997,"step_ms":0.127,"cost_ms":1.124},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/image_node","frame":5,"ssim":0.999893,"tile":1,"bevy":{"batch_keys":0,"entities":442,"extents":[],"frame":5,"frame_ms":51.783,"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.007,"step_ms":0.200,"cost_ms":2.207},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/font_weights","frame":10,"ssim":0.990279,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":2.095,"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.959,"step_ms":0.118,"cost_ms":1.077},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/font_weights","frame":5,"ssim":0.990279,"tile":17,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":5,"frame_ms":53.705,"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.834,"step_ms":0.150,"cost_ms":1.984},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/font_variations","frame":10,"ssim":0.992845,"tile":21,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":10,"frame_ms":2.342,"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.946,"step_ms":0.136,"cost_ms":1.082},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/font_variations","frame":5,"ssim":0.992845,"tile":21,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":5,"frame_ms":58.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.01,"step_ms":0.183,"cost_ms":2.193},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/text_background_colors","frame":10,"ssim":0.997735,"tile":8,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":10,"frame_ms":1.959,"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.878,"step_ms":0.109,"cost_ms":0.987},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/text_background_colors","frame":5,"ssim":0.997735,"tile":8,"bevy":{"batch_keys":0,"entities":505,"extents":[],"frame":5,"frame_ms":52.065,"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.818,"step_ms":0.167,"cost_ms":1.985},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/strikethrough_and_underline","frame":10,"ssim":0.990152,"tile":14,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":10,"frame_ms":1.971,"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.952,"step_ms":0.118,"cost_ms":1.07},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/strikethrough_and_underline","frame":5,"ssim":0.990152,"tile":14,"bevy":{"batch_keys":0,"entities":454,"extents":[],"frame":5,"frame_ms":53.746,"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.835,"step_ms":0.167,"cost_ms":2.002},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/scroll_and_overflow/overflow","frame":10,"ssim":0.998143,"tile":5,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":10,"frame_ms":1.844,"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.003,"step_ms":0.182,"cost_ms":1.185},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/scroll_and_overflow/overflow","frame":5,"ssim":0.998143,"tile":5,"bevy":{"batch_keys":0,"entities":461,"extents":[],"frame":5,"frame_ms":51.909,"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.872,"step_ms":0.133,"cost_ms":2.005},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/ui_texture_atlas","frame":10,"ssim":0.999601,"tile":7,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":10,"frame_ms":1.911,"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.944,"step_ms":0.118,"cost_ms":1.062},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/ui_texture_atlas","frame":5,"ssim":0.999601,"tile":7,"bevy":{"batch_keys":0,"entities":445,"extents":[],"frame":5,"frame_ms":51.472,"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.741,"step_ms":0.183,"cost_ms":1.924},"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":30.479,"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.293,"step_ms":0.127,"cost_ms":1.42},"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":22.557,"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.005,"step_ms":0.209,"cost_ms":1.214},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/layout/flex_layout","frame":10,"ssim":0.990851,"tile":8,"bevy":{"batch_keys":0,"entities":602,"extents":[],"frame":10,"frame_ms":33.526,"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.079,"step_ms":0.082,"cost_ms":1.161},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/scroll_and_overflow/overflow_clip_margin","frame":10,"ssim":0.996801,"tile":9,"bevy":{"batch_keys":0,"entities":465,"extents":[],"frame":10,"frame_ms":29.516,"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.029,"step_ms":0.182,"cost_ms":1.211},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/ui_texture_slice","frame":10,"ssim":0.998957,"tile":8,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":28.996,"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.863,"step_ms":0.155,"cost_ms":1.018},"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":30.548,"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.038,"step_ms":0.182,"cost_ms":1.22},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/images/ui_texture_atlas_slice","frame":10,"ssim":0.990791,"tile":17,"bevy":{"batch_keys":0,"entities":447,"extents":[],"frame":10,"frame_ms":31.271,"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.858,"step_ms":0.145,"cost_ms":2.003},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/widgets/button","frame":10,"ssim":0.999600,"tile":8,"bevy":{"batch_keys":0,"entities":444,"extents":[],"frame":10,"frame_ms":35.41,"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.206,"step_ms":0.182,"cost_ms":2.388},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/text/letter_spacing","frame":10,"ssim":0.995902,"tile":13,"bevy":{"batch_keys":0,"entities":455,"extents":[],"frame":10,"frame_ms":33.351,"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.088,"step_ms":0.127,"cost_ms":1.215},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
+{"example":"ui/styling/borders","frame":10,"ssim":0.991738,"tile":9,"bevy":{"batch_keys":0,"entities":591,"extents":[],"frame":10,"frame_ms":30.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":0.871,"step_ms":0.073,"cost_ms":0.944},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}
diff --git a/sdk/raea/bench/bevy-parity/ui/styling/borders.tsx b/sdk/raea/bench/bevy-parity/ui/styling/borders.tsx
new file mode 100644
index 00000000..4d105575
--- /dev/null
+++ b/sdk/raea/bench/bevy-parity/ui/styling/borders.tsx
@@ -0,0 +1,72 @@
+// Bevy v0.20.0 examples/ui/styling/borders.rs in raea's TSX (docs/control.feature FC0a): on a 0.25 grey panel (25 px
+// margins, stretched over the window), "Borders" over sixteen 50 x 50 maroon nodes, each with a different set of
+// border sides (10 or 20 px), its sides red, blue, yellow and green, a 6 px white outline 6 px out and a 10 px yellow
+// square in its centre, labelled in 9 px; then "Borders Rounded": the same sixteen with each corner between two
+// bordered sides as round as it can be (BorderRadius::px of f32::MAX), the square round, and four elliptical corners.
+// 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, CornerRadius, Node, Text, UiRect, percent, px, type Val } from "raea/ui";
+import { Srgba } from "raea/color";
+
+const MAROON = new Srgba(0.5019608, 0, 0);
+const YELLOW = new Srgba(1, 1, 0);
+const SIDES = { top: new Srgba(1, 0, 0), bottom: YELLOW, left: new Srgba(0, 0.5019608, 0), right: new Srgba(0, 0, 1) };
+const OUTLINE = { width: px(6), offset: px(6), color: new Srgba(1, 1, 1) };
+const F32_MAX = 3.4028234663852886e38;
+
+const LABELS = ["None", "All", "Left", "Right", "Top", "Bottom", "Horizontal", "Vertical", "Top Left", "Bottom Left", "Top Right", "Bottom Right", "Top Bottom Right", "Top Bottom Left", "Top Left Right", "Bottom Left Right"];
+const side = (left = 0, right = 0, top = 0, bottom = 0): UiRect => UiRect.new(px(left), px(right), px(top), px(bottom));
+const BORDERS: UiRect[] = [
+ side(), UiRect.all(px(10)), UiRect.left(px(10)), UiRect.right(px(10)), UiRect.top(px(10)), UiRect.bottom(px(10)), UiRect.horizontal(px(10)), UiRect.vertical(px(10)),
+ side(20, 0, 10), side(10, 0, 0, 20), side(0, 20, 10), side(0, 10, 0, 10), side(0, 10, 20, 10), side(10, 0, 10, 10), side(20, 10, 10), side(10, 10, 0, 20),
+];
+// a corner between two bordered sides is as round as it can be, the rest square
+const both = (x: Val, y: Val) => (x !== "0px" && y !== "0px" ? F32_MAX : 0);
+const ROUNDED = BORDERS.map((b) => BorderRadius.px(both(b.left, b.top), both(b.right, b.top), both(b.right, b.bottom), both(b.left, b.bottom)));
+const ELLIPSES: [string, BorderRadius][] = [
+ ["Ellipse Wide", BorderRadius.all(CornerRadius.new(px(25), px(8)))],
+ ["Ellipse Tall", BorderRadius.all(CornerRadius.new(px(8), px(25)))],
+ ["Ellipse Mixed", BorderRadius.new(CornerRadius.new(px(25), px(12)), CornerRadius.new(px(12), px(25)), CornerRadius.new(px(25), px(12)), CornerRadius.new(px(12), px(25)))],
+ ["Ellipse Percent", BorderRadius.new(CornerRadius.new(percent(50), percent(20)), CornerRadius.new(percent(20), percent(50)), CornerRadius.new(percent(50), percent(20)), CornerRadius.new(percent(20), percent(50)))],
+];
+
+type Example = { label: string; border: UiRect; radius?: BorderRadius };
+
+function Example({ label, border, radius }: Example) {
+ return (
+ <Node flex_direction="Column" align_items="Center">
+ <Node width={px(50)} height={px(50)} border={border} margin={UiRect.all(px(20))} align_items="Center" justify_content="Center" border_radius={radius} background_color={MAROON} border_color={SIDES} outline={OUTLINE}>
+ <Node width={px(10)} height={px(10)} border_radius={radius && BorderRadius.MAX} background_color={YELLOW} />
+ </Node>
+ <Text font_size={9}>{label}</Text>
+ </Node>
+ );
+}
+
+function Label({ text }: { text: string }) {
+ return (
+ <Node margin={UiRect.all(px(25))}>
+ <Text font_size={20}>{text}</Text>
+ </Node>
+ );
+}
+
+const PLAIN: Example[] = LABELS.map((label, i) => ({ label, border: BORDERS[i] }));
+const ROUND: Example[] = [...LABELS.map((label, i) => ({ label, border: BORDERS[i], radius: ROUNDED[i] })), ...ELLIPSES.map(([label, radius]) => ({ label, border: UiRect.all(px(10)), radius }))];
+
+function Shot() {
+ return (
+ <AbsoluteFill>
+ <Canvas3D layered clearColor="rgb(43, 44, 47)" />
+ <Node margin={UiRect.all(px(25))} flex_direction="Column" align_self="Stretch" justify_self="Stretch" background_color={new Srgba(0.25, 0.25, 0.25)}>
+ <Label text="Borders" />
+ <Node margin={UiRect.all(px(25))} flex_wrap="Wrap">{PLAIN.map((e) => <Example key={e.label} {...e} />)}</Node>
+ <Label text="Borders Rounded" />
+ <Node margin={UiRect.all(px(25))} flex_wrap="Wrap">{ROUND.map((e) => <Example key={e.label} {...e} />)}</Node>
+ </Node>
+ </AbsoluteFill>
+ );
+}
+
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);
diff --git a/sdk/raea/conformance/ui.test.tsx b/sdk/raea/conformance/ui.test.tsx
index 35b47ac0..97a99efc 100644
--- a/sdk/raea/conformance/ui.test.tsx
+++ b/sdk/raea/conformance/ui.test.tsx
@@ -1,7 +1,7 @@
// docs/control.feature FC0a: bevy_ui's Node, Text and TextSpan on the page, with Bevy's defaults, values and blend
// (ui/styling/transparency_ui, ui/layout/fixed_node).
import { describe, expect, test } from "bun:test";
-import { BorderRadius, FontVariationTag, ImageNode, ImagePlugin, Node, TextureAtlasLayout, Overflow, OverflowClipMargin, Text, TextShadow, Text2d, UiScale, TextSpan, UiRect, auto, percent, px, vw } from "raea/ui";
+import { BorderRadius, CornerRadius, FontVariationTag, ImageNode, ImagePlugin, Node, TextureAtlasLayout, Overflow, OverflowClipMargin, Text, TextShadow, Text2d, UiScale, TextSpan, UiRect, auto, percent, px, vw } from "raea/ui";
import { LinearRgba, Srgba } from "raea/color";
import { renderFrame } from "../src/test";
import { Transform } from "raea/transform";
@@ -182,6 +182,17 @@ describe("A sliced ImageNode, a sampled picture and UiScale", () => {
expect(html(<Text justify="Right" width={percent(100)}>hi</Text>)).toContain('white-space:pre-wrap;flex-grow:1');
expect(html(<Text justify="Left" width={percent(100)}>hi</Text>)).not.toContain("flex-grow:1");
});
+ test("corners resolve as Bevy's do with the node's px size: circular ones clamped to half its shorter side, elliptical ones per axis", () => {
+ const out = html(<Node width={px(50)} height={px(40)} border_radius={BorderRadius.px(3.4e38, 0, 10, 0)} />);
+ expect(out).toContain("border-radius:20px 0px 10px 0px");
+ const ell = html(<Node width={px(50)} height={px(40)} border_radius={BorderRadius.all(CornerRadius.new(percent(50), percent(20)))} />);
+ expect(ell).toContain("border-radius:25px 25px 25px 25px / 8px 8px 8px 8px");
+ expect(html(<Node border_radius={BorderRadius.all(px(8))} />)).toContain("border-radius:8px 8px 8px 8px");
+ });
+ test("BorderColor takes a colour per side", () => {
+ const out = html(<Node border={UiRect.all(px(2))} border_color={{ top: new Srgba(1, 0, 0), right: new Srgba(0, 0, 1), bottom: new Srgba(1, 1, 0), left: new Srgba(0, 1, 0) }} />);
+ expect(out).toContain("border-color:rgba(255, 0, 0, 1) rgba(0, 0, 255, 1) rgba(255, 255, 0, 1) rgba(0, 255, 0, 1)");
+ });
test("LetterSpacing is CSS letter-spacing, Rem of bevy_text's 20 px", () => {
expect(html(<Text letter_spacing={{ Px: 3 }}>hi</Text>)).toContain("letter-spacing:3px");
expect(html(<Text>a<TextSpan letter_spacing={{ Rem: 0.5 }}>b</TextSpan></Text>)).toContain("letter-spacing:10px");
diff --git a/sdk/raea/src/ui.ts b/sdk/raea/src/ui.ts
index a0831c90..eb57ac0c 100644
--- a/sdk/raea/src/ui.ts
+++ b/sdk/raea/src/ui.ts
@@ -6,4 +6,4 @@ export * from "@raea/video/region";
// InputRegion (input-region.tsx) joins when it is committed
export * from "@raea/video/panel";
// bevy_ui's Node and Text, and bevy_text's TextSpan, with their values (Val, UiRect, BorderRadius, Overflow)
-export { Node, Text, TextSpan, TextShadow, Text2d, UiScale, ImageNode, type TextureSlicer, type SliceScaleMode, ImagePlugin, FontVariationTag, TextureAtlasLayout, type ImageNodeProps, px, percent, vw, vh, vmin, vmax, auto, UiRect, BorderRadius, Overflow, OverflowClipMargin, type NodeProps, type TextProps, type TextStyleProps, type TextRunProps, type Text2dProps, type Val } from "@raea/render/bevy3d";
+export { Node, Text, TextSpan, TextShadow, Text2d, UiScale, ImageNode, type TextureSlicer, type SliceScaleMode, ImagePlugin, FontVariationTag, TextureAtlasLayout, type ImageNodeProps, px, percent, vw, vh, vmin, vmax, auto, UiRect, BorderRadius, CornerRadius, Overflow, OverflowClipMargin, type NodeProps, type TextProps, type TextStyleProps, type TextRunProps, type Text2dProps, type Val } from "@raea/render/bevy3d";
diff --git a/sdk/render/src/bevy3d.tsx b/sdk/render/src/bevy3d.tsx
index be93896d..f5d93483 100644
--- a/sdk/render/src/bevy3d.tsx
+++ b/sdk/render/src/bevy3d.tsx
@@ -28,5 +28,6 @@ export { Hdr } from "./bevy3d/core";
// Lightmap (bevy_pbr::lightmap): a bake on a <Model>'s glTF meshes by name (docs/control.feature FC0a)
export { Lightmap, type LightmapProps } from "./bevy3d/lightmap";
// bevy_ui's Node, Text and TextSpan, and their values, drawn by the page (docs/control.feature FC0a)
-export { Node, Text, TextSpan, TextShadow, Text2d, UiScale, ImageNode, type TextureSlicer, type SliceScaleMode, ImagePlugin, FontVariationTag, TextureAtlasLayout, type NodeProps, type TextProps, type TextStyleProps, type TextRunProps, type Text2dProps, type ImageNodeProps } from "./bevy3d/ui";
-export { px, percent, vw, vh, vmin, vmax, auto, UiRect, BorderRadius, Overflow, OverflowClipMargin, type Val } from "./bevy3d/ui-val";
+export { Node, Text, TextSpan, TextShadow, Text2d, UiScale, FontVariationTag, type NodeProps, type TextProps, type TextStyleProps, type TextRunProps, type Text2dProps } from "./bevy3d/ui";
+export { ImageNode, ImagePlugin, TextureAtlasLayout, type TextureSlicer, type SliceScaleMode, type ImageNodeProps } from "./bevy3d/ui-image";
+export { px, percent, vw, vh, vmin, vmax, auto, UiRect, BorderRadius, CornerRadius, Overflow, OverflowClipMargin, type Val } from "./bevy3d/ui-val";
diff --git a/sdk/render/src/bevy3d/ui-image.tsx b/sdk/render/src/bevy3d/ui-image.tsx
new file mode 100644
index 00000000..a184817f
--- /dev/null
+++ b/sdk/render/src/bevy3d/ui-image.tsx
@@ -0,0 +1,153 @@
+// 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 { px } from "./ui-val";
+import type { LinearRgba, Srgba } from "./colors";
+import { samplerSpec, type SamplerSpec } from "../3d/materials";
+
+type Color = Srgba | LinearRgba | string;
+
+export interface ImageNodeProps extends NodeProps {
+ /** the picture: staticFile("branding/icon.png"), or one with its own sampler ({ path, sampler: { filter: "nearest" } }, Bevy's load_with_settings) */
+ image: string | { path: string; sampler: SamplerSpec };
+ /** its tint: white (none) by default; only white or a grey multiplies here yet (a picture's brightness) */
+ color?: Srgba;
+ flip_x?: boolean;
+ 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 };
+}
+
+/** bevy_ui's SliceScaleMode: a side or the centre stretched, or tiled every slice x stretch_value px from its start */
+export type SliceScaleMode = "Stretch" | { Tile: { stretch_value: number } };
+
+/** bevy_sprite's TextureSlicer: the slices' insets in the picture's px, how the sides and centre scale (Stretch by
+ * default), and the corners' most scale (1 by default) */
+export interface TextureSlicer { border: { left: number; right: number; top: number; bottom: number }; center_scale_mode?: SliceScaleMode; sides_scale_mode?: SliceScaleMode; max_corner_scale?: number }
+
+/** bevy_image's TextureAtlasLayout: a sheet's size and its cells' rects in px. @bevy bevy_image::TextureAtlasLayout */
+export interface TextureAtlasLayout { size: [number, number]; textures: { x: number; y: number; w: number; h: number }[] }
+export const TextureAtlasLayout = {
+ /** cells of `tile` px, `columns` by `rows`, row by row from the top left; padding between cells and an offset
+ * before the first, as Bevy's from_grid has them (none by default) */
+ from_grid(tile: [number, number], columns: number, rows: number, padding?: [number, number], offset?: [number, number]): TextureAtlasLayout {
+ const [w, h] = tile, [px_, py] = padding ?? [0, 0], [ox, oy] = offset ?? [0, 0];
+ for (const n of [w, h, columns, rows]) if (!(Number.isInteger(n) && n > 0)) throw new RangeError(`TextureAtlasLayout.from_grid: tile, columns and rows are whole numbers above 0, got ${JSON.stringify([tile, columns, rows])}`);
+ const textures = [];
+ for (let r = 0; r < rows; r++) for (let c = 0; c < columns; c++) textures.push({ x: ox + c * (w + px_), y: oy + r * (h + py), w, h });
+ // (Bevy's size: (tile + padding) * grid - padding, its padding between cells only; not the offset)
+ return { size: [columns * (w + px_) - px_, rows * (h + py) - py], textures };
+ },
+};
+
+/** bevy_ui's ImageNode: a Node showing a picture stretched over its content box (inside its padding and border),
+ * sized by the picture when its width or height is auto, as bevy_ui's ImageNodeSize measures it. No children (an
+ * <img>). @bevy bevy_ui::widget::image::ImageNode */
+export function ImageNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, image_mode, ...p }: ImageNodeProps) {
+ // a picture with its own sampler: its filter is how it's drawn here (a UI picture is never wrapped or mipmapped)
+ const outer = useContext(Sampler);
+ if (typeof image === "object" && image !== null) {
+ const s = samplerSpec("ImageNode: image", image.sampler);
+ if (s.wrap !== undefined || s.anisotropy !== undefined) throw new TypeError("ImageNode: an image's sampler takes filter (and mipmap) here; a UI picture isn't wrapped");
+ const 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 (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)");
+ const grey = color === undefined || (color.red === color.green && color.green === color.blue);
+ if (!grey || (color && color.alpha !== 1)) throw new TypeError("ImageNode: color tints only by an opaque grey yet (brightness); a coloured or translucent tint is to do");
+ const ui = useContext(InUi);
+ const 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} />;
+ const root = fixed ? "fixed" : ui === null;
+ return root ? <div style={root === "fixed" ? { ...VIEWPORT, position: "fixed" } : VIEWPORT}>{img}</div> : img;
+}
+
+// an ImageNode of one atlas cell: the sheet scaled so the cell fills the content box (Bevy's UVs are the cell's rect
+// over the layout's size), the rest clipped; sized by the cell when its width and height are auto, as Bevy measures it
+function AtlasNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, ...p }: ImageNodeProps) {
+ 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)");
+ const { layout, index } = texture_atlas!;
+ const cell = layout?.textures?.[index];
+ if (!cell) throw new RangeError(`ImageNode: texture_atlas.index ${index} is not one of its layout's ${layout?.textures?.length ?? 0} cells`);
+ if (color !== undefined && !(color.red === color.green && color.green === color.blue && color.alpha === 1)) throw new TypeError("ImageNode: color tints only by an opaque grey yet (brightness); a coloured or translucent tint is to do");
+ const ui = useContext(InUi);
+ const n = nodeCss("ImageNode", { width: px(cell.w), height: px(cell.h), ...p }, ui?.back);
+ const flips = [flip_x && "scaleX(-1)", flip_y && "scaleY(-1)"].filter(Boolean).join(" ");
+ const pct = (a: number, b: number) => `${(a / b) * 100}%`;
+ const rendering = RENDERING[useContext(Sampler)];
+ const sheet: CSSProperties = {
+ position: "absolute", maxWidth: "none", ...(rendering ? { imageRendering: rendering } : {}),
+ left: pct(-cell.x, cell.w), top: pct(-cell.y, cell.h), width: pct(layout.size[0], cell.w), height: pct(layout.size[1], cell.h),
+ ...(color && color.red !== 1 ? { filter: `brightness(${color.red})` } : {}),
+ };
+ const box: CSSProperties = { position: "relative", overflow: "hidden", width: "100%", height: "100%", ...(flips ? { transform: flips } : {}) };
+ const node = <div style={n.css}><div style={box}><img src={image} style={sheet} /></div></div>;
+ const root = fixed ? "fixed" : ui === null;
+ return root ? <div style={root === "fixed" ? { ...VIEWPORT, position: "fixed" } : VIEWPORT}>{node}</div> : node;
+}
+
+// ImagePlugin's default sampler, for the pictures inside it (a <Node> tree's ImageNodes)
+const Sampler = createContext<"Linear" | "Nearest">("Linear");
+const RENDERING = { Linear: undefined, Nearest: "pixelated" } as const;
+
+/** bevy_image's ImagePlugin: its default_sampler for every picture drawn inside it (Linear by default;
+ * ImagePlugin::default_nearest() is default_sampler="Nearest", for pixel art). @bevy bevy_image::ImagePlugin */
+export function ImagePlugin({ default_sampler, children }: { default_sampler?: "Linear" | "Nearest"; children?: ReactNode }) {
+ if (default_sampler !== undefined && !(default_sampler in RENDERING)) throw new TypeError(`ImagePlugin: default_sampler is Linear or Nearest, got ${JSON.stringify(default_sampler)}`);
+ return <Sampler.Provider value={default_sampler ?? "Linear"}>{children}</Sampler.Provider>;
+}
+
+// an ImageNode cut in nine (NodeImageMode::Sliced): CSS border-image with its slices and `fill`, and bevy_ui's own
+// corner scale and tiling on data-raea-bevy-slice (raea's Blitz, render/border_image.rs). It holds children, as a
+// sliced button's label. A flipped one draws on a layer behind them (z-index -1 in the node's own stacking context,
+// 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 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 are
+ let cellOf = "";
+ if (texture_atlas !== undefined) {
+ const { layout, index } = texture_atlas;
+ const c = layout?.textures?.[index];
+ if (!c) throw new RangeError(`ImageNode: texture_atlas.index ${index} is not one of its layout's ${layout?.textures?.length ?? 0} cells`);
+ cellOf = ` cell ${c.x} ${c.y} ${c.w} ${c.h} of ${layout.size[0]} ${layout.size[1]}`;
+ }
+ if (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}`);
+ 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}`;
+ };
+ 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 ui = useContext(InUi);
+ const n = nodeCss("ImageNode", p, ui?.back);
+ const rendering = RENDERING[useContext(Sampler)];
+ const slices: CSSProperties = {
+ borderImageSource: `url("${image}")`,
+ borderImageSlice: `${b.top} ${b.right} ${b.bottom} ${b.left} fill`,
+ // CSS's own widths (the slices at max_corner_scale); Blitz scales them as bevy_ui does by the marker
+ borderImageWidth: `${b.top * max}px ${b.right * max}px ${b.bottom * max}px ${b.left * max}px`,
+ ...(rendering ? { imageRendering: rendering } : {}),
+ };
+ const root = fixed ? "fixed" : ui === null;
+ if (!flip_x && !flip_y) return boxOf({ ...n.css, ...slices }, n.back, children, root, undefined, marker);
+ const flips = [flip_x && "scaleX(-1)", flip_y && "scaleY(-1)"].filter(Boolean).join(" ");
+ const layer = <div key="raea-slices" style={{ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", zIndex: -1, transform: flips, ...slices }} {...marker} />;
+ return boxOf({ ...n.css, position: n.css.position ?? "relative", zIndex: 0 }, n.back, [layer, ...Children.toArray(children)], root);
+}
diff --git a/sdk/render/src/bevy3d/ui-val.ts b/sdk/render/src/bevy3d/ui-val.ts
index b936ead7..95b2924c 100644
--- a/sdk/render/src/bevy3d/ui-val.ts
+++ b/sdk/render/src/bevy3d/ui-val.ts
@@ -6,7 +6,7 @@ import { LinearRgba, Srgba } from "./colors";
/** A bevy_ui Val as CSS: px(12) is "12px", percent(50) "50%", auto "auto". */
export type Val = string;
-const VAL = /^(auto|-?\d+(\.\d+)?(e-?\d+)?(px|%|vw|vh|vmin|vmax))$/;
+const VAL = /^(auto|-?\d+(\.\d+)?(e[-+]?\d+)?(px|%|vw|vh|vmin|vmax))$/;
const num = (what: string, n: number) => {
if (!Number.isFinite(n)) throw new RangeError(`${what}: a finite number, got ${n}`);
return n;
@@ -49,21 +49,56 @@ export function rectCss(who: string, k: string, r: UiRect): string {
return (["top", "right", "bottom", "left"] as const).map((s) => checkVal(who, `${k}.${s}`, r[s])).join(" ");
}
-/** Bevy's BorderRadius: a Val for each corner (0 by default). */
-export interface BorderRadius { top_left: Val; top_right: Val; bottom_right: Val; bottom_left: Val }
+/** Bevy's CornerRadius: a corner's x and y radii, an elliptical corner (a Val alone is a circular one). */
+export interface CornerRadius { x: Val; y: Val }
+export const CornerRadius = {
+ new: (x: Val, y: Val): CornerRadius => ({ x, y }),
+ all: (v: Val): CornerRadius => ({ x: v, y: v }),
+ circular: (v: Val): CornerRadius => ({ x: v, y: "auto" }),
+};
+type Corner = Val | CornerRadius;
+
+/** Bevy's BorderRadius: a Val (circular) or a CornerRadius (elliptical) for each corner (0 by default). */
+export interface BorderRadius { top_left: Corner; top_right: Corner; bottom_right: Corner; bottom_left: Corner }
export const BorderRadius = {
- all: (v: Val): BorderRadius => ({ top_left: v, top_right: v, bottom_right: v, bottom_left: v }),
- new: (top_left: Val, top_right: Val, bottom_right: Val, bottom_left: Val): BorderRadius => ({ top_left, top_right, bottom_right, bottom_left }),
- top: (v: Val): BorderRadius => ({ top_left: v, top_right: v, bottom_right: Z, bottom_left: Z }),
- bottom: (v: Val): BorderRadius => ({ top_left: Z, top_right: Z, bottom_right: v, bottom_left: v }),
- left: (v: Val): BorderRadius => ({ top_left: v, top_right: Z, bottom_right: Z, bottom_left: v }),
- right: (v: Val): BorderRadius => ({ top_left: Z, top_right: v, bottom_right: v, bottom_left: Z }),
+ all: (v: Corner): BorderRadius => ({ top_left: v, top_right: v, bottom_right: v, bottom_left: v }),
+ new: (top_left: Corner, top_right: Corner, bottom_right: Corner, bottom_left: Corner): BorderRadius => ({ top_left, top_right, bottom_right, bottom_left }),
+ /** each corner circular, in px (f32::MAX's a corner as round as the node allows) */
+ px: (top_left: number, top_right: number, bottom_right: number, bottom_left: number): BorderRadius => ({ top_left: px(top_left), top_right: px(top_right), bottom_right: px(bottom_right), bottom_left: px(bottom_left) }),
+ top: (v: Corner): BorderRadius => ({ top_left: v, top_right: v, bottom_right: Z, bottom_left: Z }),
+ bottom: (v: Corner): BorderRadius => ({ top_left: Z, top_right: Z, bottom_right: v, bottom_left: v }),
+ left: (v: Corner): BorderRadius => ({ top_left: v, top_right: Z, bottom_right: Z, bottom_left: v }),
+ right: (v: Corner): BorderRadius => ({ top_left: Z, top_right: v, bottom_right: v, bottom_left: Z }),
MAX: { top_left: "9999px", top_right: "9999px", bottom_right: "9999px", bottom_left: "9999px" } as BorderRadius,
};
-export function radiusCss(who: string, r: BorderRadius): string {
+/** A Val in px of `of` px (a percent of it), or undefined for a viewport unit, which the page resolves. */
+const pxOf = (v: Val, of: number) => (v.endsWith("%") ? (parseFloat(v) / 100) * of : v.endsWith("px") ? parseFloat(v) : undefined);
+
+/** CSS border-radius as Bevy resolves the corners (CornerRadius::resolve): a circular one of the node's shorter side,
+ * clamped to half of it, an elliptical one's x of its width and y of its height, each clamped to half that. With the
+ * node's size in px (`size`, its border box), they're resolved so: CSS would instead shrink every corner together
+ * when two overlap (a round corner beside a square one, which Bevy draws half the node wide). */
+export function radiusCss(who: string, r: BorderRadius, size?: [number, number]): string {
if (typeof r !== "object" || r === null) throw new TypeError(`${who}: border_radius is a BorderRadius (BorderRadius.all(px(8))), got ${JSON.stringify(r)}`);
- return (["top_left", "top_right", "bottom_right", "bottom_left"] as const).map((s) => checkVal(who, `border_radius.${s}`, r[s])).join(" ");
+ const at = (v: Val, of: number) => {
+ const n = pxOf(v, of);
+ return n === undefined ? v : `${Math.min(Math.max(n, 0), of / 2)}px`;
+ };
+ const corners = (["top_left", "top_right", "bottom_right", "bottom_left"] as const).map((s): [string, string] => {
+ const c = r[s];
+ const k = `border_radius.${s}`;
+ const [x, y] = typeof c === "object" && c !== null ? [checkVal(who, `${k}.x`, c.x), checkVal(who, `${k}.y`, c.y)] : [checkVal(who, k, c), "auto"];
+ if (x === "auto" && y === "auto") return [Z, Z];
+ if (x === "auto" || y === "auto") {
+ const v = x === "auto" ? y : x;
+ const m = size ? at(v, Math.min(...size)) : v;
+ return [m, m];
+ }
+ return size ? [at(x, size[0]), at(y, size[1])] : [x, y];
+ });
+ const xs = corners.map((c) => c[0]).join(" "), ys = corners.map((c) => c[1]).join(" ");
+ return xs === ys ? xs : `${xs} / ${ys}`;
}
/** A Bevy enum variant as CSS's keyword (FlexStart: flex-start, SpaceBetween: space-between); Default is CSS's
diff --git a/sdk/render/src/bevy3d/ui.tsx b/sdk/render/src/bevy3d/ui.tsx
index 81a66272..90baa849 100644
--- a/sdk/render/src/bevy3d/ui.tsx
+++ b/sdk/render/src/bevy3d/ui.tsx
@@ -7,12 +7,11 @@ import { Children, createContext, useContext, type CSSProperties, type ReactNode
import { BEVY_FONT_FAMILY, bevyFontFace } from "./fonts/default";
import {
ALIGN_CONTENT, ALIGN_ITEMS, ALIGN_SELF, DISPLAY, FLEX_DIRECTION, FLEX_WRAP, JUSTIFY_CONTENT, JUSTIFY_ITEMS, JUSTIFY_SELF, OVERFLOW_AXIS, POSITION_TYPE,
- checkVal, keyword, over, px, radiusCss, rectCss, type Backdrop, type BorderRadius, type Overflow, type OverflowClipMargin, type UiRect, type Val,
+ checkVal, keyword, over, radiusCss, rectCss, type Backdrop, type BorderRadius, type Overflow, type OverflowClipMargin, type UiRect, type Val,
} from "./ui-val";
import { LinearRgba, type Srgba } from "./colors";
import type { TransformValue } from "./core";
import { eulerOf } from "../3d/model";
-import { samplerSpec, type SamplerSpec } from "../3d/materials";
import { useVideoConfig } from "@raea/app/clock";
type Color = Srgba | LinearRgba | string;
@@ -42,7 +41,8 @@ export interface NodeProps {
overflow_clip_margin?: OverflowClipMargin;
row_gap?: Val; column_gap?: Val;
background_color?: Color;
- border_color?: Color;
+ /** BorderColor: every side one colour, or each its own ({ top, right, bottom, left }) */
+ border_color?: Color | { top: Color; right: Color; bottom: Color; left: Color };
/** Outline: a line outside the border box, `offset` from it (0 by default) */
outline?: { width: Val; offset?: Val; color: Color };
z_index?: number;
@@ -52,7 +52,7 @@ export interface NodeProps {
}
// inside a Node (null at the top: a Node there is a root), and what lies under its content when known
-const InUi = createContext<{ back: Backdrop } | null>(null);
+export const InUi = createContext<{ back: Backdrop } | null>(null);
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> = {
@@ -99,7 +99,9 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSP
s.borderStyle = "solid";
s.borderColor = "transparent";
}
- if (p.border_radius !== undefined) s.borderRadius = radiusCss(who, p.border_radius);
+ // (its corners as Bevy resolves them, of its size when that is in px)
+ const wh = [p.width, p.height].map((v) => (typeof v === "string" && /^[\d.e+-]+px$/.test(v) ? parseFloat(v) : NaN));
+ if (p.border_radius !== undefined) s.borderRadius = radiusCss(who, p.border_radius, wh.every(Number.isFinite) ? (wh as [number, number]) : undefined);
// (the outline is outside the node: over what is under the node, not its own background)
if (p.outline !== undefined) {
s.outline = `${checkVal(who, "outline.width", p.outline.width)} solid ${over(who, "outline.color", p.outline.color, back).css}`;
@@ -107,7 +109,11 @@ export function nodeCss(who: string, p: NodeProps, back?: Backdrop): { css: CSSP
}
if (p.background_color !== undefined) ({ css: s.backgroundColor, back } = over(who, "background_color", p.background_color, back));
// (the border over its own background, as Bevy draws it)
- if (p.border_color !== undefined) s.borderColor = over(who, "border_color", p.border_color, back).css;
+ const bc = p.border_color;
+ if (bc !== undefined && typeof bc === "object" && "top" in bc) {
+ const side = (k: "top" | "right" | "bottom" | "left") => over(who, `border_color.${k}`, bc[k], back).css;
+ s.borderColor = `${side("top")} ${side("right")} ${side("bottom")} ${side("left")}`;
+ } else if (bc !== undefined) s.borderColor = over(who, "border_color", bc, back).css;
if (p.overflow !== undefined) {
const o = p.overflow;
for (const a of ["x", "y"] as const) if (!OVERFLOW_AXIS.includes(o?.[a])) throw new TypeError(`${who}: overflow.${a} is one of ${OVERFLOW_AXIS.join(", ")}, got ${JSON.stringify(o?.[a])}`);
@@ -124,9 +130,9 @@ 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 axes
-const VIEWPORT: CSSProperties = { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", display: "grid", alignItems: "start", justifyItems: "start" };
+export const VIEWPORT: CSSProperties = { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", display: "grid", alignItems: "start", justifyItems: "start" };
-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>) {
const inner = (
<div style={css} {...attrs}>
<InUi.Provider value={{ back }}>{children}</InUi.Provider>
@@ -311,105 +317,6 @@ export function TextSpan({ children, underline, strikethrough, underline_color,
);
}
-export interface ImageNodeProps extends NodeProps {
- /** the picture: staticFile("branding/icon.png"), or one with its own sampler ({ path, sampler: { filter: "nearest" } }, Bevy's load_with_settings) */
- image: string | { path: string; sampler: SamplerSpec };
- /** its tint: white (none) by default; only white or a grey multiplies here yet (a picture's brightness) */
- color?: Srgba;
- flip_x?: boolean;
- 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 };
-}
-
-/** bevy_ui's SliceScaleMode: a side or the centre stretched, or tiled every slice x stretch_value px from its start */
-export type SliceScaleMode = "Stretch" | { Tile: { stretch_value: number } };
-
-/** bevy_sprite's TextureSlicer: the slices' insets in the picture's px, how the sides and centre scale (Stretch by
- * default), and the corners' most scale (1 by default) */
-export interface TextureSlicer { border: { left: number; right: number; top: number; bottom: number }; center_scale_mode?: SliceScaleMode; sides_scale_mode?: SliceScaleMode; max_corner_scale?: number }
-
-/** bevy_image's TextureAtlasLayout: a sheet's size and its cells' rects in px. @bevy bevy_image::TextureAtlasLayout */
-export interface TextureAtlasLayout { size: [number, number]; textures: { x: number; y: number; w: number; h: number }[] }
-export const TextureAtlasLayout = {
- /** cells of `tile` px, `columns` by `rows`, row by row from the top left; padding between cells and an offset
- * before the first, as Bevy's from_grid has them (none by default) */
- from_grid(tile: [number, number], columns: number, rows: number, padding?: [number, number], offset?: [number, number]): TextureAtlasLayout {
- const [w, h] = tile, [px_, py] = padding ?? [0, 0], [ox, oy] = offset ?? [0, 0];
- for (const n of [w, h, columns, rows]) if (!(Number.isInteger(n) && n > 0)) throw new RangeError(`TextureAtlasLayout.from_grid: tile, columns and rows are whole numbers above 0, got ${JSON.stringify([tile, columns, rows])}`);
- const textures = [];
- for (let r = 0; r < rows; r++) for (let c = 0; c < columns; c++) textures.push({ x: ox + c * (w + px_), y: oy + r * (h + py), w, h });
- // (Bevy's size: (tile + padding) * grid - padding, its padding between cells only; not the offset)
- return { size: [columns * (w + px_) - px_, rows * (h + py) - py], textures };
- },
-};
-
-/** bevy_ui's ImageNode: a Node showing a picture stretched over its content box (inside its padding and border),
- * sized by the picture when its width or height is auto, as bevy_ui's ImageNodeSize measures it. No children (an
- * <img>). @bevy bevy_ui::widget::image::ImageNode */
-export function ImageNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, image_mode, ...p }: ImageNodeProps) {
- // a picture with its own sampler: its filter is how it's drawn here (a UI picture is never wrapped or mipmapped)
- const outer = useContext(Sampler);
- if (typeof image === "object" && image !== null) {
- const s = samplerSpec("ImageNode: image", image.sampler);
- if (s.wrap !== undefined || s.anisotropy !== undefined) throw new TypeError("ImageNode: an image's sampler takes filter (and mipmap) here; a UI picture isn't wrapped");
- const 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 (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)");
- const grey = color === undefined || (color.red === color.green && color.green === color.blue);
- if (!grey || (color && color.alpha !== 1)) throw new TypeError("ImageNode: color tints only by an opaque grey yet (brightness); a coloured or translucent tint is to do");
- const ui = useContext(InUi);
- const 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} />;
- const root = fixed ? "fixed" : ui === null;
- return root ? <div style={root === "fixed" ? { ...VIEWPORT, position: "fixed" } : VIEWPORT}>{img}</div> : img;
-}
-
-// an ImageNode of one atlas cell: the sheet scaled so the cell fills the content box (Bevy's UVs are the cell's rect
-// over the layout's size), the rest clipped; sized by the cell when its width and height are auto, as Bevy measures it
-function AtlasNode({ image, color, flip_x, flip_y, children, fixed, texture_atlas, ...p }: ImageNodeProps) {
- 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)");
- const { layout, index } = texture_atlas!;
- const cell = layout?.textures?.[index];
- if (!cell) throw new RangeError(`ImageNode: texture_atlas.index ${index} is not one of its layout's ${layout?.textures?.length ?? 0} cells`);
- if (color !== undefined && !(color.red === color.green && color.green === color.blue && color.alpha === 1)) throw new TypeError("ImageNode: color tints only by an opaque grey yet (brightness); a coloured or translucent tint is to do");
- const ui = useContext(InUi);
- const n = nodeCss("ImageNode", { width: px(cell.w), height: px(cell.h), ...p }, ui?.back);
- const flips = [flip_x && "scaleX(-1)", flip_y && "scaleY(-1)"].filter(Boolean).join(" ");
- const pct = (a: number, b: number) => `${(a / b) * 100}%`;
- const rendering = RENDERING[useContext(Sampler)];
- const sheet: CSSProperties = {
- position: "absolute", maxWidth: "none", ...(rendering ? { imageRendering: rendering } : {}),
- left: pct(-cell.x, cell.w), top: pct(-cell.y, cell.h), width: pct(layout.size[0], cell.w), height: pct(layout.size[1], cell.h),
- ...(color && color.red !== 1 ? { filter: `brightness(${color.red})` } : {}),
- };
- const box: CSSProperties = { position: "relative", overflow: "hidden", width: "100%", height: "100%", ...(flips ? { transform: flips } : {}) };
- const node = <div style={n.css}><div style={box}><img src={image} style={sheet} /></div></div>;
- const root = fixed ? "fixed" : ui === null;
- return root ? <div style={root === "fixed" ? { ...VIEWPORT, position: "fixed" } : VIEWPORT}>{node}</div> : node;
-}
-
-// ImagePlugin's default sampler, for the pictures inside it (a <Node> tree's ImageNodes)
-const Sampler = createContext<"Linear" | "Nearest">("Linear");
-const RENDERING = { Linear: undefined, Nearest: "pixelated" } as const;
-
-/** bevy_image's ImagePlugin: its default_sampler for every picture drawn inside it (Linear by default;
- * ImagePlugin::default_nearest() is default_sampler="Nearest", for pixel art). @bevy bevy_image::ImagePlugin */
-export function ImagePlugin({ default_sampler, children }: { default_sampler?: "Linear" | "Nearest"; children?: ReactNode }) {
- if (default_sampler !== undefined && !(default_sampler in RENDERING)) throw new TypeError(`ImagePlugin: default_sampler is Linear or Nearest, got ${JSON.stringify(default_sampler)}`);
- return <Sampler.Provider value={default_sampler ?? "Linear"}>{children}</Sampler.Provider>;
-}
export interface Text2dProps extends TextStyleProps, TextRunProps {
/** its place in Bevy's 2D world: the frame's centre the origin, +Y up, a unit a pixel, turns counterclockwise */
@@ -440,49 +347,6 @@ export function Text2d({ transform, justify, children, ...text }: Text2dProps) {
);
}
-// an ImageNode cut in nine (NodeImageMode::Sliced): CSS border-image with its slices and `fill`, and bevy_ui's own
-// corner scale and tiling on data-raea-bevy-slice (raea's Blitz, render/border_image.rs). It holds children, as a
-// sliced button's label. A flipped one draws on a layer behind them (z-index -1 in the node's own stacking context,
-// 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 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 are
- let cellOf = "";
- if (texture_atlas !== undefined) {
- const { layout, index } = texture_atlas;
- const c = layout?.textures?.[index];
- if (!c) throw new RangeError(`ImageNode: texture_atlas.index ${index} is not one of its layout's ${layout?.textures?.length ?? 0} cells`);
- cellOf = ` cell ${c.x} ${c.y} ${c.w} ${c.h} of ${layout.size[0]} ${layout.size[1]}`;
- }
- if (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}`);
- 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}`;
- };
- 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 ui = useContext(InUi);
- const n = nodeCss("ImageNode", p, ui?.back);
- const rendering = RENDERING[useContext(Sampler)];
- const slices: CSSProperties = {
- borderImageSource: `url("${image}")`,
- borderImageSlice: `${b.top} ${b.right} ${b.bottom} ${b.left} fill`,
- // CSS's own widths (the slices at max_corner_scale); Blitz scales them as bevy_ui does by the marker
- borderImageWidth: `${b.top * max}px ${b.right * max}px ${b.bottom * max}px ${b.left * max}px`,
- ...(rendering ? { imageRendering: rendering } : {}),
- };
- const root = fixed ? "fixed" : ui === null;
- if (!flip_x && !flip_y) return boxOf({ ...n.css, ...slices }, n.back, children, root, undefined, marker);
- const flips = [flip_x && "scaleX(-1)", flip_y && "scaleY(-1)"].filter(Boolean).join(" ");
- const layer = <div key="raea-slices" style={{ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", zIndex: -1, transform: flips, ...slices }} {...marker} />;
- return boxOf({ ...n.css, position: n.css.position ?? "relative", zIndex: 0 }, n.back, [layer, ...Children.toArray(children)], root);
-}
/** 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
diff --git a/sdk/skills/raea/reference/sdk.md b/sdk/skills/raea/reference/sdk.md
index 0e6b138b..2a99c36d 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`, `BorderRadius`, `FontVariationTag`, `ImageNode`, `ImagePlugin`, `Node`, `Overflow`, `OverflowClipMargin`, `Text`, `Text2d`, `TextShadow`, `TextSpan`, `TextureAtlasLayout`, `UiRect`, `UiScale`, `auto`, `percent`, `px`, `vh`, `vmax`, `vmin`, `vw`
+`AbsoluteFill`, `BorderRadius`, `CornerRadius`, `FontVariationTag`, `ImageNode`, `ImagePlugin`, `Node`, `Overflow`, `OverflowClipMargin`, `Text`, `Text2d`, `TextShadow`, `TextSpan`, `TextureAtlasLayout`, `UiRect`, `UiScale`, `auto`, `percent`, `px`, `vh`, `vmax`, `vmin`, `vw`
## `raea/video` (sdk/raea/src/video.ts)
diff --git a/vendor/blitz-paint/src/kurbo_css/css_box.rs b/vendor/blitz-paint/src/kurbo_css/css_box.rs
index 72274c4c..61dca47e 100644
--- a/vendor/blitz-paint/src/kurbo_css/css_box.rs
+++ b/vendor/blitz-paint/src/kurbo_css/css_box.rs
@@ -38,6 +38,8 @@ pub struct CssBox {
pub padding_width: Insets,
pub border_width: Insets,
pub outline_width: f64,
+ /// raea: outline-offset, in device px (0 unless set after `new`)
+ pub outline_offset: f64,
pub border_radii: NonUniformRoundedRectRadii,
}
@@ -80,6 +82,7 @@ impl CssBox {
content_box,
outline_box,
outline_width,
+ outline_offset: 0.0,
padding_width: padding,
border_width: border,
border_radii,
@@ -197,17 +200,20 @@ impl CssBox {
}
/// Construct a bezpath drawing the outline
+ /// raea: the ring `outline_offset` to `outline_offset + outline_width` outside the border box, each corner the
+ /// border's radius grown by its distance out and square where the border's is (css-ui-4 §3.3, and bevy_ui's
+ /// ComputedNode::outline_radius); it's filled even-odd (Blitz drew it from the border box, ignoring the offset,
+ /// and rounded a square corner by the width)
pub fn outline(&self) -> BezPath {
- // raea: two boxes' corners sized up front
let mut path = BezPath::with_capacity(32);
-
- // TODO: this has been known to produce quirky outputs with hugely rounded edges
- self.shape(&mut path, CssBoxKind::OutlineBox, Direction::Clockwise);
- path.move_to(self.corner(Corner::TopLeft, CssBoxKind::BorderBox));
-
- self.shape(&mut path, CssBoxKind::BorderBox, Direction::Anticlockwise);
- path.move_to(self.corner(Corner::TopLeft, CssBoxKind::BorderBox));
-
+ let o = self.outline_offset;
+ let r = &self.border_radii;
+ let grown = |by: f64| {
+ let g = |c: Vec2| if c.x > 0.0 && c.y > 0.0 { Vec2::new((c.x + by).max(0.0), (c.y + by).max(0.0)) } else { Vec2::ZERO };
+ [g(r.top_left), g(r.top_right), g(r.bottom_right), g(r.bottom_left)]
+ };
+ rounded_rect(&mut path, self.border_box.inset(o + self.outline_width), grown(o + self.outline_width));
+ rounded_rect(&mut path, self.border_box.inset(o), grown(o));
path
}
@@ -1047,3 +1053,25 @@ impl kurbo::Shape for BoxShape {
}
}
}
+
+/// raea: a rect with elliptical corners ([top left, top right, bottom right, bottom left], each (rx, ry), zero
+/// square), traced clockwise from the top left corner's end as one closed subpath of `path`
+fn rounded_rect(path: &mut BezPath, rect: Rect, radii: [Vec2; 4]) {
+ let Rect { x0, y0, x1, y1 } = rect;
+ let [tl, tr, br, bl] = radii;
+ let mut corner = |path: &mut BezPath, center: Point, radii: Vec2, start: f64| {
+ if radii.x > 0.0 && radii.y > 0.0 {
+ path.line_to(center + Vec2::new(radii.x * start.cos(), radii.y * start.sin()));
+ let arc = Arc { center, radii, start_angle: start, sweep_angle: FRAC_PI_2, x_rotation: 0.0 };
+ path.extend(arc.append_iter(0.1));
+ } else {
+ path.line_to(center);
+ }
+ };
+ path.move_to((x0 + tl.x, y0));
+ corner(path, Point::new(x1 - tr.x, y0 + tr.y), tr, -FRAC_PI_2);
+ corner(path, Point::new(x1 - br.x, y1 - br.y), br, 0.0);
+ corner(path, Point::new(x0 + bl.x, y1 - bl.y), bl, FRAC_PI_2);
+ corner(path, Point::new(x0 + tl.x, y0 + tl.y), tl, PI);
+ path.close_path();
+}
diff --git a/vendor/blitz-paint/src/render.rs b/vendor/blitz-paint/src/render.rs
index 2d4f08a8..23d16265 100644
--- a/vendor/blitz-paint/src/render.rs
+++ b/vendor/blitz-paint/src/render.rs
@@ -2343,7 +2343,10 @@ fn create_css_rect(style: &ComputedValues, layout: &Layout, scale: f64) -> CssBo
bottom_left: resolve_radii(&s_border.border_bottom_left_radius),
};
- CssBox::new(border_box, border, padding, outline_width, border_radii)
+ // raea: outline-offset, which the outline is drawn out by
+ let mut frame = CssBox::new(border_box, border, padding, outline_width, border_radii);
+ frame.outline_offset = style.get_outline().outline_offset.to_f64_px() * scale;
+ frame
}
/// raea: what an overflow clip clips to: overflow-clip-margin's visual box (the padding box by default), grown by its
diff --git a/vendor/blitz-paint/src/render/border.rs b/vendor/blitz-paint/src/render/border.rs
index f3859f41..fd214473 100644
--- a/vendor/blitz-paint/src/render/border.rs
+++ b/vendor/blitz-paint/src/render/border.rs
@@ -842,6 +842,7 @@ impl ElementCx<'_, '_> {
| BorderStyle::Double => self.frame.outline(),
};
- scene.fill(Fill::NonZero, self.transform, color, None, &path);
+ // raea: even-odd, the ring between its two rounded rects (CssBox::outline)
+ scene.fill(Fill::EvenOdd, self.transform, color, None, &path);
}
}