Update deleteClone for cube coords

This commit is contained in:
2024-06-28 15:10:28 -07:00
parent ade861767b
commit 83457c5218
2 changed files with 12 additions and 21 deletions

View File

@@ -9,16 +9,9 @@ function traceSelector(counter) {
}
function getCellPosition(cell) {
let pt = new DOMPoint(0, 0),
transform = getComputedStyle(cell).transform.match(/-?\d+\.?\d*/g),
mtx = new DOMMatrix(transform);
pt = pt.matrixTransform(mtx);
const [x, y] = cell.getAttributeNS(null, 'transform').match(/-?\d+\.?\d*/g);
transform = getComputedStyle(cell.parentElement).transform.match(/-?\d+\.?\d*/g);
mtx = new DOMMatrix(transform);
pt = pt.matrixTransform(mtx);
return pt;
return { x, y };
}
function getClones(svg, counter) {
@@ -35,12 +28,9 @@ function addMoveToHistory(selected) {
}
function updatePlacement(cell, selected, clone) {
const prevCoords = [
clone.parentElement.dataset.x,
clone.parentElement.parentElement.dataset.y
]
const { q, r, s, t } = clone.parentElement.dataset;
selected.dataset.previous = prevCoords;
selected.dataset.previous = [q, r, s, t];
cell.appendChild(selected);
Array.from(selected.children).forEach(n => {