Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: Dependencies
on:
pull_request:
paths:
- '**/Cargo.toml'
- 'deny.toml'
- "**/Cargo.toml"
- "deny.toml"
push:
paths:
- '**/Cargo.toml'
- 'deny.toml'
- "**/Cargo.toml"
- "deny.toml"
branches-ignore:
- 'dependabot/**'
- "dependabot/**"
- staging-squash-merge.tmp
schedule:
- cron: "0 0 * * 0"
Expand All @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: master
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'master' }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand All @@ -40,7 +40,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: master
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'master' }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand All @@ -54,7 +54,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: master
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'master' }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand All @@ -68,7 +68,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: master
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'master' }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand Down
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ license = "MIT OR Apache-2.0"
name = "bevy_prototype_lyon"
readme = "README.md"
repository = "https://github.com/Nilirad/bevy_prototype_lyon/"
version = "0.13.0"
version = "0.14.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.15.0", default-features = false, features = [
"bevy_sprite",
"bevy_render",
"bevy_core_pipeline",
bevy = { version = "0.16", default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
"bevy_log",
"bevy_render",
"bevy_sprite",
] }
lyon_tessellation = "1"
lyon_algorithms = "1"
svgtypes = "0.15"

[dev-dependencies]
bevy = "0.15.0"
bevy = "0.16"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The following table shows the latest version of `bevy_prototype_lyon` that suppo

|bevy|bevy_prototype_lyon|license|
|---|---|---|
|0.16|0.14|MIT/Apache 2.0|
|0.15|0.13|MIT/Apache 2.0|
|0.14|0.12|MIT/Apache 2.0|
|0.13|0.11|MIT/Apache 2.0|
Expand All @@ -82,8 +83,8 @@ The following table shows the latest version of `bevy_prototype_lyon` that suppo

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

Expand Down
9 changes: 6 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = 2
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
ignore = [
"RUSTSEC-2022-0048", # xml-rs unmaintained
"RUSTSEC-2024-0436", # `paste` unmaintained, but is a Bevy dependency
]
yanked = "deny"

Expand All @@ -23,7 +23,10 @@ allow = [
"CC0-1.0",
]
exceptions = [
{ name = "unicode-ident", allow = ["Unicode-DFS-2016", "Unicode-3.0"] },
{ name = "unicode-ident", allow = [
"Unicode-DFS-2016",
"Unicode-3.0",
] },
]

[[licenses.clarify]]
Expand All @@ -32,7 +35,7 @@ license-files = []
name = "stretch"

[bans]
multiple-versions = "allow"
multiple-versions = "allow"
wildcards = "allow"

[sources]
Expand Down
9 changes: 6 additions & 3 deletions examples/dynamic_shape.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
use std::f64::consts::PI;

use bevy::{color::palettes::css::*, prelude::*};
use bevy::{color::palettes::css::*, input::common_conditions::input_just_pressed, prelude::*};
use bevy_prototype_lyon::prelude::*;

fn main() {
App::new()
.add_plugins((DefaultPlugins, ShapePlugin))
.add_systems(Startup, setup_system)
.add_systems(Update, redraw_shape)
.add_systems(
Update,
redraw_shape.run_if(input_just_pressed(KeyCode::Space)),
)
.add_systems(Update, rotate_shape_system)
.run();
}
Expand All @@ -34,7 +37,7 @@ fn redraw_shape(mut query: Query<&mut Shape, With<ExampleShape>>, time: Res<Time
..shapes::RegularPolygon::default()
};

let mut shape = query.single_mut();
let mut shape = query.single_mut().expect("Shape entity must always exist");
*shape = ShapeBuilder::with(&polygon)
.fill(color)
.stroke((BLACK, outline_width as f32))
Expand Down
4 changes: 2 additions & 2 deletions examples/dynamic_stroke_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn rotate_shape_by_size(mut query: Query<(&mut Transform, &Shape)>, time: Res<Ti
fn redraw_line_width(mut query: Query<&mut Shape, With<HexagonShape>>, time: Res<Time>) {
let outline_width = 2.0 + time.elapsed_secs_f64().sin().abs() * 10.0;

let mut shape = query.single_mut();
let mut shape = query.single_mut().expect("Shape entity must always exist");
shape.stroke = shape.stroke.map(|mut s| {
s.options.line_width = outline_width as f32;
s
Expand All @@ -57,7 +57,7 @@ fn redraw_fill(mut query: Query<&mut Shape, With<TriangleShape>>, time: Res<Time
let hue = (time.elapsed_secs_f64() * 50.0) % 360.0;
let color = Color::hsl(hue as f32, 1.0, 0.5);

let mut shape = query.single_mut();
let mut shape = query.single_mut().expect("Shape entity must always exist");
shape.fill = shape.fill.map(|mut f| {
f.color = color;
f
Expand Down
2 changes: 1 addition & 1 deletion src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Default for ShapeBundle {
///
/// It can be constructed using `ShapeBuilder`.
#[derive(Component, Default, Clone)]
#[require(Mesh2d, MeshMaterial2d<ColorMaterial>(color_material_handle), Transform, Visibility)]
#[require(Mesh2d, MeshMaterial2d<ColorMaterial> = color_material_handle(), Transform, Visibility)]
#[non_exhaustive]
pub struct Shape {
/// Geometry of a shape.
Expand Down
2 changes: 1 addition & 1 deletion src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ fn match_action(action: Action, b: &mut WithSvg<BuilderImpl>) {
Action::Close => {
b.close();
}
};
}
}
3 changes: 2 additions & 1 deletion src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! boilerplate.

use bevy::{
asset::weak_handle,
prelude::*,
render::{mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology},
};
Expand All @@ -16,7 +17,7 @@ use crate::{
};

pub(crate) const COLOR_MATERIAL_HANDLE: Handle<ColorMaterial> =
Handle::weak_from_u128(0x7CC6_61A1_0CD6_C147_129A_2C01_882D_9580);
weak_handle!("7cc661a1-0cd6-c147-129a-2c01882d9580");

/// A plugin that provides resources and a system to draw shapes in Bevy with
/// less boilerplate.
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct SvgPathShape {
pub svg_path_string: String,
}
fn get_y_in_bevy_orientation(y: f64) -> f32 {
y as f32 * -1.
-(y as f32)
}
fn get_y_after_offset(y: f64, offset_y: f32) -> f32 {
get_y_in_bevy_orientation(y) + offset_y
Expand Down
Loading