Skip to content

Commit

Permalink
Fixed movement tool visual bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanR712 committed May 11, 2024
1 parent cddad59 commit 4a50641
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ProofTools/ProofMoveMultiTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function proofMoveMultiMouseDown(event: MouseEvent): void {
currentParent.remove(startingPoint);
}
legalNode = true;
redrawTree(currentProofTree);
redrawTree(TreeContext.currentProofStep!.tree);
highlightNode(currentNode, legalColor());
} else {
legalNode = false;
Expand All @@ -84,7 +84,7 @@ export function proofMoveMultiMouseMove(event: MouseEvent): void {
event.y - startingPoint.y
);

redrawTree(currentProofTree);
redrawTree(TreeContext.currentProofStep!.tree);
if (currentNode instanceof CutNode) {
const tempCut: CutNode = alterCutChildren(currentNode, moveDifference);
const color = isMoveLegal(currentProofTree, tempCut) ? legalColor() : illegalColor();
Expand Down
4 changes: 2 additions & 2 deletions src/ProofTools/ProofMoveSingleTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function proofMoveSingleMouseDown(event: MouseEvent): void {
}
legalNode = true;

redrawTree(currentProofTree);
redrawTree(TreeContext.currentProofStep!.tree);
if (currentNode instanceof AtomNode) {
drawAtom(currentNode, legalColor(), true);
} else {
Expand All @@ -94,7 +94,7 @@ export function proofMoveSingleMouseMove(event: MouseEvent): void {
event.y - startingPoint.y
);

redrawTree(currentProofTree);
redrawTree(TreeContext.currentProofStep!.tree);
if (currentNode instanceof CutNode) {
const tempCut: CutNode = alterCut(currentNode, moveDifference);
const color = isMoveLegal(currentProofTree, tempCut) ? legalColor() : illegalColor();
Expand Down
3 changes: 1 addition & 2 deletions src/ProofTools/ProofResizeTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
determineDirection,
drawCut,
redrawProof,
redrawTree,
} from "../SharedToolUtils/DrawUtils";
import {CutNode} from "../AEG/CutNode";
import {ellipseLargeEnough, resizeCut} from "../SharedToolUtils/EditModeUtils";
Expand Down Expand Up @@ -94,7 +93,7 @@ export function proofResizeMouseMove(event: MouseEvent): void {
if (currentNode instanceof CutNode) {
const tempCut: CutNode = resizeCut(currentNode, moveDifference, direction);
if (tempCut.ellipse !== null) {
redrawTree(currentProofTree);
redrawProof();
const color = isValid(tempCut) ? legalColor() : illegalColor();
drawCut(tempCut, color);
determineAndChangeCursorStyle(color, "cursor: crosshair", "cursor: no-drop");
Expand Down

0 comments on commit 4a50641

Please sign in to comment.