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 元素。 |
黑客帝国 | SVGMatrix | null | 要使用反向屏幕 CTM。 |
返回:
SVGPoint
具有 .x 和 .y 属性的对象。