Skip to content

Commit

Permalink
Merge pull request #275 from RAIRLab/266-copy-single-for-cut-after-a-…
Browse files Browse the repository at this point in the history
…global-move-does-not-redraw-from-new-position

Copy after global move quick bug squash
  • Loading branch information
RyanR712 authored Dec 3, 2023
2 parents ba7773e + abd0422 commit f5ea0c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DrawModes/CopySingleTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5ea0c6

Please sign in to comment.