From abd0422929c19d00366a4a39f7ff8f1dc01f31da Mon Sep 17 00:00:00 2001 From: Ryan Reilly Date: Sat, 2 Dec 2023 21:35:07 -0500 Subject: [PATCH] Added offset calculation in copySingleMouseDown --- src/DrawModes/CopySingleTool.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DrawModes/CopySingleTool.ts b/src/DrawModes/CopySingleTool.ts index 9e86ebce..04baa0c7 100644 --- a/src/DrawModes/CopySingleTool.ts +++ b/src/DrawModes/CopySingleTool.ts @@ -30,11 +30,12 @@ let legalNode: boolean; export function copySingleMouseDown(event: MouseEvent) { startingPoint = new Point(event.x - offset.x, event.y - offset.y); const realNode: CutNode | AtomNode | null = treeContext.tree.getLowestNode(startingPoint); + const moveDifference: Point = new Point(event.x - startingPoint.x, event.y - startingPoint.y); if (realNode !== treeContext.tree.sheet && realNode !== null) { if (realNode instanceof CutNode) { //The cut node loses custody of its children because those do not copy over during //copy single mode - currentNode = alterCut(realNode, new Point(0, 0)); + currentNode = alterCut(realNode, moveDifference); currentNode.children = []; } else if (realNode instanceof AtomNode) { currentNode = realNode;