mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 10:31:35 +00:00
Fix f2f randomization
This commit is contained in:
parent
d5f6e2cbd8
commit
2d6cc04d2b
@ -13,7 +13,6 @@ import {
|
|||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { PhotoSizeSelectActual } from '@mui/icons-material';
|
import { PhotoSizeSelectActual } from '@mui/icons-material';
|
||||||
import Map from '../Map';
|
import Map from '../Map';
|
||||||
import { randomNumberBetween } from '@mui/x-data-grid/utils/utils';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@ -44,8 +43,10 @@ const F2fMapDialog = ({
|
|||||||
|
|
||||||
const onSave = () => {
|
const onSave = () => {
|
||||||
if (position && position[0] && position[1]) {
|
if (position && position[0] && position[1]) {
|
||||||
const randomAggregator = randomNumberBetween(Math.random(), -0.005, 0.005);
|
onClose([
|
||||||
onClose([position[0] + randomAggregator(), position[1] + randomAggregator()]);
|
position[0] + Math.random() * 0.02 - 0.01,
|
||||||
|
position[1] + Math.random() * 0.02 - 0.01,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user