Skip to content

Commit

Permalink
fix(mind): fix defects in dblclick and moving #WIK-16158 (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
huanhuanwa authored Jul 29, 2024
1 parent 6155196 commit a47f09a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/nine-rockets-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@plait/draw': patch
'@plait/mind': patch
---

fix defects in dblclick and moving
8 changes: 3 additions & 5 deletions packages/draw/src/plugins/with-arrow-line-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ export const withArrowLineText = (board: PlaitBoard) => {
board.dblClick = (event: MouseEvent) => {
if (!PlaitBoard.isReadonly(board)) {
const clickPoint = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
const hitTarget = getHitElementByPoint(board, clickPoint, (element: PlaitElement) => {
return PlaitDrawElement.isArrowLine(element);
}) as undefined | PlaitArrowLine;
const hitTargetPath = hitTarget && PlaitBoard.findPath(board, hitTarget);
if (hitTarget) {
const hitTarget = getHitElementByPoint(board, clickPoint) as undefined | PlaitArrowLine;
if (hitTarget && PlaitDrawElement.isArrowLine(hitTarget)) {
const hitTargetPath = hitTarget && PlaitBoard.findPath(board, hitTarget);
const points = getArrowLinePoints(board, hitTarget);
const point = getNearestPointBetweenPointAndSegments(clickPoint, points);
const texts = hitTarget.texts?.length ? [...hitTarget.texts] : [];
Expand Down
1 change: 1 addition & 0 deletions packages/mind/src/plugins/with-node-dnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const withNodeDnd = (board: PlaitBoard) => {
});

PlaitBoard.getHost(board).appendChild(dragFakeNodeG);
return;
}

pointerMove(event);
Expand Down

0 comments on commit a47f09a

Please sign in to comment.