Consider the HTML code below:
<canvas id="taF" draggable="true" ondrag="canvasDragging(event)">
No Canvas Support!
</canvas>
And this is canvasDragging and context.translate codes:
// Canvas Context
let contextX = 1000, contextY = 0;
context.translate( contextX, contextY );
// Dragging
const canvasDragging = ( event ) => {
contextX = event.offsetX;
contextY = event.offsetY;
}
I have checked the event and its properties but when I drag the canvas, the canvas doesn't translate and change its viewport.
Any help would be considered as a great help!