Skip to main content

Home > blockly > browserEvents > mouseToSvg

browserEvents.mouseToSvg() function

Returns the converted coordinates of the given mouse event. The origin (0,0) is the top-left corner of the Blockly SVG.

Signature:

export declare function mouseToSvg(e: MouseEvent, svg: SVGSVGElement, matrix: SVGMatrix | null): SVGPoint;

Parameters

ParameterTypeDescription
eMouseEventMouse event.
svgSVGSVGElementSVG element.
matrixSVGMatrix | nullInverted screen CTM to use.

Returns:

SVGPoint

Object with .x and .y properties.