Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanR712 committed Dec 8, 2023
1 parent 992f4f8 commit 28cc282
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/DrawModes/DeleteSingleTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function deleteSingleMouseDown(event: MouseEvent) {
currentNode !== treeContext.tree.sheet
) {
readdChildren(currentNode);
currentNode.children = [];
}
redrawTree(treeContext.tree);
if (currentNode instanceof AtomNode) {
Expand Down Expand Up @@ -106,9 +105,9 @@ export function deleteSingleMouseMove(event: MouseEvent) {
export function deleteSingleMouseUp(event: MouseEvent) {
const newPoint: Point = new Point(event.x - offset.x, event.y - offset.y);
if (legalNode) {
const currentParent = treeContext.tree.getLowestNode(newPoint);
if (currentParent !== null && currentParent instanceof CutNode) {
currentParent.remove(newPoint);
const currentNode = treeContext.tree.getLowestNode(newPoint);
if (currentNode !== null && currentNode instanceof CutNode) {
currentNode.remove(newPoint);
}
if (
currentNode !== treeContext.tree.sheet &&
Expand All @@ -130,7 +129,6 @@ export function deleteSingleMouseUp(event: MouseEvent) {
export function deleteSingleMouseOut() {
currentNode = null;
legalNode = false;
redrawTree(treeContext.tree);
}

/**
Expand Down

0 comments on commit 28cc282

Please sign in to comment.