fix: polish stuff a bit

This commit is contained in:
Nova
2024-06-27 16:51:33 -04:00
parent d17841ec7a
commit f08f3e4e4b
11 changed files with 104 additions and 98 deletions

View File

@@ -101,8 +101,10 @@ impl Drop for Lines {
pub fn draw_all(token: &MainThreadToken) {
for lines in LINES_REGISTRY.get_valid_contents() {
if lines.space.node().unwrap().enabled() {
lines.draw(token);
if let Some(node) = lines.space.node() {
if node.enabled() {
lines.draw(token);
}
}
}
}

View File

@@ -163,8 +163,10 @@ impl Drop for Text {
pub fn draw_all(token: &MainThreadToken) {
for text in TEXT_REGISTRY.get_valid_contents() {
if text.space.node().unwrap().enabled() {
text.draw(token);
if let Some(node) = text.space.node() {
if node.enabled() {
text.draw(token);
}
}
}
}

View File

@@ -160,7 +160,7 @@ impl FieldRefAspect for Field {
) -> Result<f32> {
let reference_space = space.get_aspect::<Spatial>()?;
let field = node.get_aspect::<Field>()?;
Ok(field.distance(&reference_space, point.into()).into())
Ok(field.distance(&reference_space, point.into()))
}
async fn normal(