From 2d6cc04d2b17bfa9c34ff1e92662d6d2d272dbbb Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Tue, 17 Oct 2023 08:10:52 -0700 Subject: [PATCH] Fix f2f randomization --- frontend/src/components/Dialogs/F2fMap.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Dialogs/F2fMap.tsx b/frontend/src/components/Dialogs/F2fMap.tsx index fdf71ce4..940d0c22 100644 --- a/frontend/src/components/Dialogs/F2fMap.tsx +++ b/frontend/src/components/Dialogs/F2fMap.tsx @@ -13,7 +13,6 @@ import { } from '@mui/material'; import { PhotoSizeSelectActual } from '@mui/icons-material'; import Map from '../Map'; -import { randomNumberBetween } from '@mui/x-data-grid/utils/utils'; interface Props { open: boolean; @@ -44,8 +43,10 @@ const F2fMapDialog = ({ const onSave = () => { if (position && position[0] && position[1]) { - const randomAggregator = randomNumberBetween(Math.random(), -0.005, 0.005); - onClose([position[0] + randomAggregator(), position[1] + randomAggregator()]); + onClose([ + position[0] + Math.random() * 0.02 - 0.01, + position[1] + Math.random() * 0.02 - 0.01, + ]); } };