Skip to content

Commit

Permalink
fix stupid mistake when displaying map coords by double tap
Browse files Browse the repository at this point in the history
  • Loading branch information
rand256 committed Jan 24, 2023
1 parent e2ed176 commit 469b829
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/zone/js-modules/vacuum-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,11 @@ export function VacuumMap(canvasElement) {
if(!takenAction && !options.noGotoPoints) {
locations.push(new GotoPoint(tappedPoint.x, tappedPoint.y));
// show current coordinates in alert message by double tap (but only when allowed to set a new point on the map)
if ((Date.now() - lastTap.d < 5e2) && Math.abs(lastTap.x - tappedX) < 10 && Math.abs(lastTap.y - tappedY) < 10) {
if ((Date.now() - lastTap.d < 5e2) && Math.abs(lastTap.x - tappedPoint.x) < 10 && Math.abs(lastTap.y - tappedPoint.y) < 10) {
window.alert(JSON.stringify(convertToRealCoords(lastTap)));
lastTap = {x: null, y: null, d: 0};
} else {
lastTap = {x: tappedX, y: tappedY, d: Date.now()};
lastTap = {x: tappedPoint.x, y: tappedPoint.y, d: Date.now()};
}

}
Expand Down

0 comments on commit 469b829

Please sign in to comment.