Skip to content

Commit

Permalink
fix for insertion messing up after a drag - added extra offset in cal…
Browse files Browse the repository at this point in the history
…culation oopsies
  • Loading branch information
AnushaTiwari5 committed Dec 6, 2023
1 parent e720f85 commit 3e6ca2b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ProofTools/InsertionTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,9 @@ export function insertionMouseOut() {
*/
function calculatePoint(event: MouseEvent, node: CutNode | AtomNode): Point | undefined {
if (node instanceof CutNode && node.ellipse !== null) {
return new Point(
event.x - node.ellipse.center.x - offset.x,
event.y - node.ellipse.center.y - offset.y
);
return new Point(event.x - node.ellipse.center.x, event.y - node.ellipse.center.y);
} else if (node instanceof AtomNode) {
return new Point(event.x - node.origin.x - offset.x, event.y - node.origin.y - offset.y);
return new Point(event.x - node.origin.x, event.y - node.origin.y);
}

return undefined;
Expand Down

0 comments on commit 3e6ca2b

Please sign in to comment.