Skip to content

Commit

Permalink
now no magnet menu for a removed magnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Schwarzentruber committed Feb 16, 2024
1 parent 11e85b1 commit 61d1454
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/GUIActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ export class GUIActions {
const magnets = MagnetManager.getMagnets();
for (let i = 0; i < magnets.length; i++) {
const m = magnets[i];
if (S.inRectangle({ x: x, y: y }, magnetGetRectangle(m))) {
return m;
}
if (m.style.visibility != "hidden")
/*note that for performance issue etc., a removed magnet is not really removed but just hidden.
So we check that the magnet is visible */
if (S.inRectangle({ x: x, y: y }, magnetGetRectangle(m))) {
return m;
}
}
return undefined;
}
Expand Down

0 comments on commit 61d1454

Please sign in to comment.