mirror of
https://github.com/igorski/bitmappery.git
synced 2026-06-17 03:34:56 +02:00
Use passed event properties instead of window.event in global to local point conversion
This commit is contained in:
@@ -123,8 +123,8 @@ export const pointerToCanvasCoordinates = ( pointerX, pointerY, zoomableCanvas,
|
||||
// ( pointer coordinate - bounding box coordinate ) is coordinate relative to canvas
|
||||
// by dividing this by the zoomFactor the value is scaled to the canvas' relative scale
|
||||
|
||||
const offsetX = ( event.pageX - canvasBoundingBox.left ) / zoomFactor;
|
||||
const offsetY = ( event.pageY - canvasBoundingBox.top ) / zoomFactor;
|
||||
const offsetX = ( pointerX - canvasBoundingBox.left ) / zoomFactor;
|
||||
const offsetY = ( pointerY - canvasBoundingBox.top ) / zoomFactor;
|
||||
|
||||
// subtract the canvas viewport position to get the coordinate relative to currently
|
||||
// visible area within the BitMappery document
|
||||
|
||||
Reference in New Issue
Block a user