add percent val
This commit is contained in:
parent
bcb9d59ea5
commit
ca257d9e01
13
Cargo.toml
13
Cargo.toml
|
@ -8,19 +8,6 @@ authors = ["Rowan Vixen <rowan@kitsu.cafe>", "jms55"]
|
||||||
bevy = "0.13.1"
|
bevy = "0.13.1"
|
||||||
bevy_mod_picking = "0.18.2"
|
bevy_mod_picking = "0.18.2"
|
||||||
dioxus = "0.4.3"
|
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]
|
[features]
|
||||||
#hot_reload = ["dioxus/hot-reload", "dioxus-rsx", "dioxus-hot-reload"]
|
#hot_reload = ["dioxus/hot-reload", "dioxus-rsx", "dioxus-hot-reload"]
|
||||||
|
|
|
@ -3,7 +3,7 @@ use bevy::{
|
||||||
ecs::{
|
ecs::{
|
||||||
component::ComponentId,
|
component::ComponentId,
|
||||||
event::{Event, EventIterator, Events, ManualEventReader},
|
event::{Event, EventIterator, Events, ManualEventReader},
|
||||||
query::{QueryData, QueryFilter, ReadOnlyQueryData, WorldQuery},
|
query::{QueryFilter, ReadOnlyQueryData},
|
||||||
system::{Query, Resource, SystemState},
|
system::{Query, Resource, SystemState},
|
||||||
world::World,
|
world::World,
|
||||||
},
|
},
|
||||||
|
|
|
@ -243,5 +243,10 @@ fn parse_val(val: &str) -> Val {
|
||||||
return Val::Vh(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}`.");
|
panic!("Encountered invalid bevy_dioxus Val `{val}`.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue