From 507d0435ffc4da3b66f49fb7cdfbfbd385280e3f Mon Sep 17 00:00:00 2001 From: Juha Paananen Date: Thu, 1 Feb 2024 20:50:00 +0200 Subject: [PATCH] Start from the center in perf-tester as well --- perf-tester/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perf-tester/src/index.ts b/perf-tester/src/index.ts index d02a3fc5c..1920ad55d 100644 --- a/perf-tester/src/index.ts +++ b/perf-tester/src/index.ts @@ -1,5 +1,5 @@ import { sleep } from "../../common/src/sleep" -import { isNote, newNote, Point } from "../../common/src/domain" +import { defaultBoardSize, isNote, newNote, Point } from "../../common/src/domain" import { GenericServerConnection } from "../../frontend/src/store/server-connection" import WebSocket from "ws" import _ from "lodash" @@ -16,7 +16,8 @@ function add(a: Point, b: Point) { function createTester(nickname: string, boardId: string) { let counter = 0 - const center = { x: 10 + Math.random() * 60, y: 10 + Math.random() * 40 } + const { width, height } = defaultBoardSize + const center = { x: width / 2 - 30 + Math.random() * 60, y: height / 2 - 20 + Math.random() * 40 } const radius = 10 + Math.random() * 10 const increment = Math.random() * 4 - 2 const WS_ADDRESS = `${DOMAIN ? "wss" : "ws"}://${DOMAIN ?? "localhost:1337"}/socket/board/${boardId}`