Update deleteClone for cube coords
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user