refactor: replace deepCopy with structuredClone

This commit is contained in:
Azgaar 2026-03-09 23:05:27 +01:00
parent 7a49098425
commit 1116cc5e0f
9 changed files with 123 additions and 142 deletions

View file

@ -1141,7 +1141,6 @@ function reGraph() {
pack.cells = packCells;
pack.cells.p = newCells.p;
pack.cells.g = createTypedArray({maxValue: grid.points.length, from: newCells.g});
pack.cells.q = d3.quadtree(newCells.p.map(([x, y], i) => [x, y, i]));
pack.cells.h = createTypedArray({maxValue: 100, from: newCells.h});
pack.cells.area = createTypedArray({maxValue: UINT16_MAX, length: packCells.i.length}).map((_, cellId) => {
const area = Math.abs(d3.polygonArea(getPackPolygon(cellId)));
@ -1234,7 +1233,7 @@ function showStatistics() {
INFO && console.info(stats);
// Dispatch event for test automation and external integrations
window.dispatchEvent(new CustomEvent('map:generated', { detail: { seed, mapId } }));
window.dispatchEvent(new CustomEvent("map:generated", {detail: {seed, mapId}}));
}
const regenerateMap = debounce(async function (options) {