Skip to content

Commit

Permalink
fix: use relative bounds after choices render
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaul committed Mar 17, 2024
1 parent 55fdecf commit b72e929
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,11 @@ export class AvoidOverlap {
choice(bodyToMove.node);

// Update the position of the body in the system
const bounds = bodyToMove.node.getBoundingClientRect();
const bounds = getRelativeBounds(
bodyToMove.node.getBoundingClientRect(),
parentBounds
);

const newBody = updateTree(tree, bodyToMove, bounds.x, bounds.y);
savePositionHistory(newBody, `choice, ${choice}`);

Expand Down

0 comments on commit b72e929

Please sign in to comment.