function embedPanMove(e) {
    embedCoordinate = getCoordinate(e);
    if (!simulationArea.touch || e.touches.length === 1) {
        const rect = simulationArea.canvas.getBoundingClientRect();
        simulationArea.mouseRawX = (embedCoordinate.x - rect.left) * DPR;
        simulationArea.mouseRawY = (embedCoordinate.y - rect.top) * DPR;
        simulationArea.mouseXf = (simulationArea.mouseRawX - globalScope.ox) / globalScope.scale;
        simulationArea.mouseYf = (simulationArea.mouseRawY - globalScope.oy) / globalScope.scale;
        simulationArea.mouseX = Math.round(simulationArea.mouseXf / unit) * unit;
        simulationArea.mouseY = Math.round(simulationArea.mouseYf / unit) * unit;
        updateCanvasSet(true);
        if (simulationArea.lastSelected == globalScope.root) {
            updateCanvasSet(true);
            let fn;
            fn = function () {
                updateSelectionsAndPane();
            };

            scheduleUpdate(0, 20, fn);
        } else {
            scheduleUpdate(0, 200);
        }
    }

    if (simulationArea.touch && e.touches.length === 2) {
        pinchZoom(e);
    }
}
Function embedPanMove
This function hepls to move simulator and its elements using touch and mouse
For now variable name starts with mouse like mouseDown are used both
     touch and mouse will change in future