blockly > browserEvents > mouseToSvg

BrowserEvents.mouseToSvg() 函式

傳回指定滑鼠事件的轉換座標。來源 (0,0) 是 Blockly SVG 的左上角。

Signature:

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

參數

參數 類型 說明
e MouseEvent 滑鼠事件。
svg SVGSVGElement SVG 元素。
matrix SVGMatrix | 空值 使用的螢幕 CTM 反轉。

傳回:

SVGPoint

含有 .x 和 .y 屬性的物件。