diff --git a/rmf_site_editor/src/interaction/select/select_anchor.rs b/rmf_site_editor/src/interaction/select/select_anchor.rs index 671223d8..975fcf10 100644 --- a/rmf_site_editor/src/interaction/select/select_anchor.rs +++ b/rmf_site_editor/src/interaction/select/select_anchor.rs @@ -18,8 +18,8 @@ use bevy::prelude::*; use bevy_impulse::*; -use crate::{site::CurrentLevel, interaction::select::*}; -use rmf_site_format::{Fiducial, Floor, Location, Path, Point, LevelElevation}; +use crate::{interaction::select::*, site::CurrentLevel}; +use rmf_site_format::{Fiducial, Floor, LevelElevation, Location, Path, Point}; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Resource)] pub enum AnchorScope { @@ -151,7 +151,10 @@ impl<'w, 's> AnchorSelection<'w, 's> { } pub fn create_walls(&mut self) { - self.create_edges_with_texture::>(EdgeContinuity::Continuous, AnchorScope::General); + self.create_edges_with_texture::>( + EdgeContinuity::Continuous, + AnchorScope::General, + ); } pub fn create_door(&mut self) { @@ -207,7 +210,9 @@ impl<'w, 's> AnchorSelection<'w, 's> { ) { let state = self .commands - .spawn(SelectorInput(CreateEdges::new_with_texture::(continuity, scope))) + .spawn(SelectorInput(CreateEdges::new_with_texture::( + continuity, scope, + ))) .id(); self.send(RunSelector { @@ -536,9 +541,9 @@ pub struct AnchorFilter<'w, 's> { impl<'w, 's> SelectionFilter for AnchorFilter<'w, 's> { fn filter_pick(&mut self, select: Entity) -> Option { - self.inspect.filter_pick(select).and_then(|e| { - self.filter_target(e) - }) + self.inspect + .filter_pick(select) + .and_then(|e| self.filter_target(e)) } fn filter_select(&mut self, target: Entity) -> Option { @@ -607,7 +612,7 @@ impl<'w, 's> SelectionFilter for AnchorFilter<'w, 's> { } } -impl<'w, 's> AnchorFilter<'w ,'s> { +impl<'w, 's> AnchorFilter<'w, 's> { fn filter_anchor(&mut self, target: Entity) -> Option { if self.anchors.contains(target) { Some(target) diff --git a/rmf_site_editor/src/site/fiducial.rs b/rmf_site_editor/src/site/fiducial.rs index 58133c3c..b1b58aba 100644 --- a/rmf_site_editor/src/site/fiducial.rs +++ b/rmf_site_editor/src/site/fiducial.rs @@ -291,13 +291,14 @@ pub fn update_fiducial_for_moved_anchors( for dependents in &changed_anchors { for dependent in dependents.iter() { if let Ok((e, point, mut tf)) = fiducials.get_mut(*dependent) { - let position = match anchors.point_in_parent_frame_of(point.0, Category::Fiducial, e) { - Ok(position) => position, - Err(err) => { - error!("failed to update fiducial: {err}"); - continue; - } - }; + let position = + match anchors.point_in_parent_frame_of(point.0, Category::Fiducial, e) { + Ok(position) => position, + Err(err) => { + error!("failed to update fiducial: {err}"); + continue; + } + }; tf.translation = position; } } diff --git a/rmf_site_editor/src/widgets/inspector/inspect_fiducial.rs b/rmf_site_editor/src/widgets/inspector/inspect_fiducial.rs index 376304cd..f6e51e30 100644 --- a/rmf_site_editor/src/widgets/inspector/inspect_fiducial.rs +++ b/rmf_site_editor/src/widgets/inspector/inspect_fiducial.rs @@ -17,8 +17,8 @@ use crate::{ site::{ - Affiliation, Change, FiducialGroup, FiducialMarker, FiducialUsage, - Group, NameInSite, NameOfSite, + Affiliation, Change, FiducialGroup, FiducialMarker, FiducialUsage, Group, NameInSite, + NameOfSite, }, widgets::{prelude::*, Icons, Inspect, InspectionPlugin}, }; @@ -99,7 +99,12 @@ impl<'w, 's> WidgetSystem for InspectFiducial<'w, 's> { error!( "Unable to find usage tracker for parent {:?} [{}] of fiducial {:?}", parent.get(), - params.names.get(parent.get()).ok().map(|n| n.0.as_str()).unwrap_or(""), + params + .names + .get(parent.get()) + .ok() + .map(|n| n.0.as_str()) + .unwrap_or(""), selection, ); return;