封鎖 >utils >svgMath >getRelativeXY

utils.svgMath.getRelativeXY() 函式

傳回這個元素左上角相對於父項的座標。僅適用於 SVG 元素和子項 (例如 rect、g、path)。

Signature:

export declare function getRelativeXY(element: Element): Coordinate;

參數

參數 類型 說明
元素 元素 用於找出座標的 SVG 元素。

傳回:

座標

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