torusDebug = {
const log = draggableLog;
const view = cloneTemplate(torusTemplate);
const svg = view.querySelector("svg");
const draggables = Array.from(svg.querySelectorAll(".draggable"));
for (const draggable of draggables) {
}
const main = draggables[0];
function drag(dx, dy) {
let { x, y } = main.pos;
x += dx;
y += dy;
x += 50;
x -= 100 * Math.floor(x / 100);
x -= 50;
y += 50;
y -= 100 * Math.floor(y / 100);
y -= 50;
for (const i of [0, 1]) {
for (const j of [0, 1]) {
const { pos } = draggables[i + 2 * j];
pos.x = x + 100 * i;
pos.y = y + 100 * j;
}
}
}
debugMakeDraggable(log, draggables, drag);
return view;
}