mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-10 20:39:36 -06:00
Apply review fixes
- crates/engine/src/tools/drag.rs
This commit is contained in:
@@ -236,7 +236,12 @@ impl Session {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// A connector dragged away from shapes that stay put comes unglued at those ends.
|
// A connector dragged away from shapes that stay put comes unglued at those ends.
|
||||||
let moved: Vec<ShapeId> = origs2.iter().map(|o| o.0).collect();
|
let mut moved: Vec<ShapeId> = vec![];
|
||||||
|
for (id, _) in &origs2 {
|
||||||
|
if let Some(sh) = deckcraft_model::find_shape(list, *id) {
|
||||||
|
deckcraft_model::walk(std::slice::from_ref(sh), &mut |s, _| moved.push(s.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
for sh in list.iter_mut().filter(|s| moved.contains(&s.id)) {
|
for sh in list.iter_mut().filter(|s| moved.contains(&s.id)) {
|
||||||
if let ShapeKind::Connector { start, end } = &mut sh.kind {
|
if let ShapeKind::Connector { start, end } = &mut sh.kind {
|
||||||
for c in [start, end] {
|
for c in [start, end] {
|
||||||
|
|||||||
Reference in New Issue
Block a user