封鎖 >utils >svgPaths >lineOnAxis
utils.svgPaths.lineOnAxis() 函式
繪製水平或垂直線。第一個引數會指定方向以及指定位置是相對或絕對位置。這些座標為無單位,因此在使用者座標系統中。詳情請參閱 developer.mozilla.org/zh-TW/docs/Web/SVG/Attribute/d#LineTo_path_commands
Signature:
export declare function lineOnAxis(command: string, val: number): string;
參數
參數 |
類型 |
說明 |
Command 鍵 |
字串 |
座標之前的指令。應為以下其中一個值:V、v、H、h。 |
Val |
數字 |
傳送至指令的座標。可以是絕對或相對的。 |
傳回:
字串
格式為「指令 val '
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-10-15 (世界標準時間)。
[null,null,["上次更新時間:2024-10-15 (世界標準時間)。"],[[["The `utils.svgPaths.lineOnAxis()` function generates SVG path commands for drawing horizontal (H, h) or vertical (V, v) lines."],["It takes a command string (V, v, H, h) specifying the line's direction and coordinate type (absolute or relative), and a numeric value representing the line's position in user coordinates."],["The function returns a formatted string that can be used within an SVG path's `d` attribute to render the line."],["These coordinates are unitless and are in the user coordinate system, for further information refer to the documentation on SVG Path LineTo commands: [developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#LineTo_path_commands](developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#LineTo_path_commands)."]]],[]]