From 839177e6a5f3acc40acc7238cb71d2d9e8eaca91 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Wed, 13 May 2026 15:28:32 -0700 Subject: [PATCH 1/4] Upgrade to Bevy 0.19 --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 801f901..aa9a9e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ version = "0.16.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.18.0", default-features = false, features = [ +bevy = { version = "0.19.0-rc.1", default-features = false, features = [ "bevy_asset", "bevy_log", "bevy_render", @@ -27,4 +27,4 @@ lyon_algorithms = "1" svgtypes = "0.15" [dev-dependencies] -bevy = "0.18.0" +bevy = "0.19.0-rc.1" From 6d844e216e463ee7ec4569f67a0dd78d2544fc9d Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Wed, 13 May 2026 15:44:20 -0700 Subject: [PATCH 2/4] Allow unicode license This is from a subdep of bevy that we have no control over. The license seems to require some sort of attribution, but this feels like not really out concern. --- deny.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/deny.toml b/deny.toml index e7a47e8..8313192 100644 --- a/deny.toml +++ b/deny.toml @@ -21,6 +21,7 @@ allow = [ "0BSD", "BSD-2-Clause", "CC0-1.0", + "Unicode-3.0", ] exceptions = [ { name = "unicode-ident", allow = [ From fc97b8f6fcdca456b10cb84f93069c5d676de14d Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Sun, 21 Jun 2026 07:53:03 -0700 Subject: [PATCH 3/4] Use official release --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aa9a9e3..c2c256a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ version = "0.16.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.19.0-rc.1", default-features = false, features = [ +bevy = { version = "0.19.0", default-features = false, features = [ "bevy_asset", "bevy_log", "bevy_render", @@ -27,4 +27,4 @@ lyon_algorithms = "1" svgtypes = "0.15" [dev-dependencies] -bevy = "0.19.0-rc.1" +bevy = "0.19.0" From 1c54ad2b68572dd674c70cfee13ff924b72107cc Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Sun, 21 Jun 2026 09:37:27 -0700 Subject: [PATCH 4/4] Use bsn in `svg.rs` --- examples/svg.rs | 77 +++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/examples/svg.rs b/examples/svg.rs index 3a154ea..ced5f9b 100644 --- a/examples/svg.rs +++ b/examples/svg.rs @@ -8,39 +8,40 @@ fn main() { .run(); } -fn setup_system(mut commands: Commands) { - commands.spawn((Camera2d, Msaa::Sample4)); +// The tolerance for tesselating curves, in the same units as the svg path +const CURVE_TOLERANCE: f32 = 0.01; - // The tolerance for tesselating curves, in the same units as the svg path - let tolerance = 0.01; - // Equivalent ot the "svg viewport" +fn chat_icon() -> Shape { + // Equivalent to the "svg viewport" let svg_doc_size_in_px = Vec2::new(24., 24.); let icon_fill = Fill { - options: FillOptions::tolerance(tolerance), + options: FillOptions::tolerance(CURVE_TOLERANCE), color: color::palettes::tailwind::GRAY_50.into(), }; + + ShapeBuilder::with(&shapes::SvgPathShape { + svg_path_string: CHAT_CODE.to_owned(), + svg_doc_size_in_px, + }) + .fill(icon_fill) + .build() +} + +// A composite shape made of multiple SVG paths +fn planet_icon() -> impl Scene { + // Equivalent to the "svg viewport" + let svg_doc_size_in_px = Vec2::new(24., 24.); + + let icon_fill = Fill { + options: FillOptions::tolerance(CURVE_TOLERANCE), + color: color::palettes::tailwind::GRAY_50.into(), + }; + let icon_fill_grey = Fill { - options: FillOptions::tolerance(tolerance), + options: FillOptions::tolerance(CURVE_TOLERANCE), color: color::palettes::tailwind::GRAY_400.into(), }; - let scale = Vec2::splat(10.).extend(1.); - - commands.spawn(( - ShapeBuilder::with(&shapes::SvgPathShape { - svg_path_string: CHAT_CODE.to_owned(), - svg_doc_size_in_px, - }) - .fill(icon_fill) - .build(), - Transform { - translation: Vec3::new(-200., 0., 0.), - scale, - ..Default::default() - }, - )); - - // A composite shape made of multiple SVG paths let planet_shape = ShapeBuilder::with(&shapes::SvgPathShape { svg_path_string: PLANET.to_owned(), @@ -56,15 +57,35 @@ fn setup_system(mut commands: Commands) { .fill(icon_fill_grey) .build(); + bsn! { + template_value(planet_shape) + Children [ + template_value(planet_mid_shape) + ] + } +} + +fn setup_system(mut commands: Commands) { + commands.spawn((Camera2d, Msaa::Sample4)); + + let scale = Vec2::splat(10.).extend(1.); + commands.spawn(( - planet_shape, + chat_icon(), Transform { - translation: Vec3::new(200., 0., 0.), + translation: Vec3::new(-200., 0., 0.), scale, - ..default() + ..Default::default() }, - children![planet_mid_shape], )); + + commands.spawn_scene(bsn! { + planet_icon() + Transform { + translation: Vec3::new(200., 0., 0.), + scale, + } + }); } // SVG paths by 480 Design under the CC BY 4.0 license