[fix] Only delete bindings if they were attached to a deleted group shape (#617)
* Only delete bindings if they were attached to a deleted group shape * Update TransformSingleSession.ts
This commit is contained in:
parent
1dd71f8b5e
commit
8039016416
2 changed files with 3 additions and 3 deletions
|
@ -149,11 +149,13 @@ export function groupShapes(
|
|||
|
||||
const { bindings } = app
|
||||
|
||||
const deletedGroupIdsSet = new Set(deletedGroupIds)
|
||||
|
||||
// We also need to delete bindings that reference the deleted shapes
|
||||
bindings.forEach((binding) => {
|
||||
for (const id of [binding.toId, binding.fromId]) {
|
||||
// If the binding references a deleted shape...
|
||||
if (afterShapes[id] === undefined) {
|
||||
if (deletedGroupIdsSet.has(id)) {
|
||||
// Delete this binding
|
||||
beforeBindings[binding.id] = binding
|
||||
afterBindings[binding.id] = undefined
|
||||
|
|
|
@ -228,8 +228,6 @@ export class TransformSingleSession extends BaseSession {
|
|||
|
||||
if (initialShape.isLocked) return
|
||||
|
||||
console.log('completed', this.app.originPoint, this.app.currentPoint)
|
||||
|
||||
if (this.isCreate && Vec.dist(this.app.originPoint, this.app.currentPoint) < 2) {
|
||||
return this.cancel()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue