fix: address raised issues

This commit is contained in:
DominicTheD3v
2026-10-30 21:13:44 +00:00
parent 32ef926c46
commit 82adf7326e
4 changed files with 143 additions and 14 deletions
+5 -6
View File
@@ -303,7 +303,8 @@ impl Session {
Some(Hit::TableRow { id, row }) => self.begin_table_border(id, false, row, p)?,
Some(Hit::Resize { id, handle }) => {
let ids: Vec<ShapeId> = if st.selection.shapes.contains(&id) { st.selection.shapes.clone() } else { vec![id] };
let origs: Vec<(ShapeId, Xfrm)> = ids.iter().filter_map(|i| {st.shape(*i).filter(|s| !s.locked).map(|s| (*i, xfrm_of(&st.doc, &st.selection, s)))}).collect();
let origs: Vec<(ShapeId, Xfrm)> =
ids.iter().filter_map(|i| st.shape(*i).filter(|s| !s.locked).map(|s| (*i, xfrm_of(&st.doc, &st.selection, s)))).collect();
let ids: Vec<ShapeId> = origs.iter().map(|(id, _)| *id).collect();
self.begin("Size");
self.tool.drag = Some(Drag::Resize { ids, handle, origs, start: p });
@@ -562,12 +563,10 @@ impl Session {
}
}
Some(Drag::Resize { origs, .. }) => {
let changed: Vec<ShapeId> = origs.iter()
let changed: Vec<ShapeId> = origs
.iter()
.filter_map(|(id, orig)| {
let current = self.active()
.and_then(|st| st.shape(*id).map(|s| {
xfrm_of(&st.doc, &st.selection, s)
}))?;
let current = self.active().and_then(|st| st.shape(*id).map(|s| xfrm_of(&st.doc, &st.selection, s)))?;
(current != *orig).then_some(*id)
})