add percent val

This commit is contained in:
Rowan 2024-03-26 05:00:47 -04:00
parent bcb9d59ea5
commit ca257d9e01
3 changed files with 6 additions and 14 deletions

View file

@ -8,19 +8,6 @@ authors = ["Rowan Vixen <rowan@kitsu.cafe>", "jms55"]
bevy = "0.13.1"
bevy_mod_picking = "0.18.2"
dioxus = "0.4.3"
#dioxus = { git = "https://github.com/ealmloff/dioxus", branch = "fix-event-bubbling", default-features = false, features = [
# "macro",
# "hooks",
#] }
#dioxus-rsx = { git = "https://github.com/ealmloff/dioxus", branch = "fix-event-bubbling", default-features = false, features = [
# "hot_reload",
#], optional = true }
#dioxus-hot-reload = { git = "https://github.com/ealmloff/dioxus", branch = "fix-event-bubbling", default-features = false, features = [
# "custom_file_watcher",
#], optional = true }
#bevy_mod_picking = { version = "0.17", default-features = false, features = [
# "backend_bevy_ui",
#] }
[features]
#hot_reload = ["dioxus/hot-reload", "dioxus-rsx", "dioxus-hot-reload"]

View file

@ -3,7 +3,7 @@ use bevy::{
ecs::{
component::ComponentId,
event::{Event, EventIterator, Events, ManualEventReader},
query::{QueryData, QueryFilter, ReadOnlyQueryData, WorldQuery},
query::{QueryFilter, ReadOnlyQueryData},
system::{Query, Resource, SystemState},
world::World,
},

View file

@ -243,5 +243,10 @@ fn parse_val(val: &str) -> Val {
return Val::Vh(val);
}
}
if let Some((val, "")) = val.split_once("%") {
if let Ok(val) = val.parse::<f32>() {
return Val::Percent(val);
}
}
panic!("Encountered invalid bevy_dioxus Val `{val}`.");
}