Fixed visual bugs

This commit is contained in:
Danil Boldyrev 2023-06-04 03:38:21 +03:00
parent 1a49178330
commit ad3d6d9a22

View File

@ -622,13 +622,14 @@ onUiLoaded(async() => {
panSpeed = 3.5; panSpeed = 3.5;
} }
elemData[elemId].panX = elemData[elemId].panX += movementX * panSpeed;
elemData[elemId].panX + movementX * panSpeed; elemData[elemId].panY += movementY * panSpeed;
elemData[elemId].panY =
elemData[elemId].panY + movementY * panSpeed;
targetElement.style.transform = `translate(${elemData[elemId].panX}px, ${elemData[elemId].panY}px) scale(${elemData[elemId].zoomLevel})`; // Delayed redraw of an element
toggleOverlap("on"); requestAnimationFrame(() => {
targetElement.style.transform = `translate(${elemData[elemId].panX}px, ${elemData[elemId].panY}px) scale(${elemData[elemId].zoomLevel})`;
toggleOverlap("on");
});
} }
function handleMoveByKey(e) { function handleMoveByKey(e) {