Skip to content

Commit

Permalink
upd: prevent docking to block which is predicting
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 10, 2023
1 parent fc6c41c commit 8860d40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions packages/visual-flow/src/model/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export abstract class Block extends ModelBase {
}

isDockableBy(block: Block): null | [number, Direction, Point] {
if (this === block || this.predicting) return null;
let minDockingDistanceSquare = MIN_DOCKING_DISTANCE_SQUARE;
let dockingInfo: [Direction, Point] | null = null;
for (const direction of this.dockableDirections) {
Expand Down
1 change: 0 additions & 1 deletion packages/visual-flow/src/model/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ export class Graph {
for (let i = this.blockZIndex.length - 1; i >= 0; i--) {
const target = this.blockZIndex[i];
if (!target) continue;
if (target === block) continue;
const result = target.isDockableBy(block);
if (result !== null) {
const [distanceSquare, ...dockingInfo] = result;
Expand Down

0 comments on commit 8860d40

Please sign in to comment.