Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
  • Loading branch information
mxgrey committed Aug 22, 2024
1 parent fdcd8c0 commit 8bf165d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions rmf_site_editor/src/interaction/select/place_object_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use crate::{
interaction::select::*,
site::{
Anchor, AnchorBundle, Dependents, FrameMarker, Model, NameInSite,
NameInWorkcell, Pending, SiteID, WorkcellModel,
Anchor, AnchorBundle, Dependents, FrameMarker, Model, NameInSite, NameInWorkcell, Pending,
SiteID, WorkcellModel,
},
widgets::canvas_tooltips::CanvasTooltips,
WorkspaceMarker,
Expand Down Expand Up @@ -466,15 +466,18 @@ pub fn on_placement_chosen_3d(
let mut access = access.get_mut(&key).or_broken_buffer()?;
let state = access.pull().or_broken_state()?;

let parent = state.parent.and_then(|p|
if frames.contains(p) {
Some(p)
} else {
// The selected parent is not a frame, so find the first ancestor
// that contains a FrameMarker
AncestorIter::new(&parents, p).find(|e| frames.contains(*e))
}
).unwrap_or(state.workspace);
let parent = state
.parent
.and_then(|p| {
if frames.contains(p) {
Some(p)
} else {
// The selected parent is not a frame, so find the first ancestor
// that contains a FrameMarker
AncestorIter::new(&parents, p).find(|e| frames.contains(*e))
}
})
.unwrap_or(state.workspace);

let parent_tf = global_tfs.get(parent).or_broken_query()?;
let inv_tf = parent_tf.affine().inverse();
Expand Down

0 comments on commit 8bf165d

Please sign in to comment.