blockly > utils > svgPaths > lineTo
utils.svgPaths.lineTo() function
Draw a line from the current point to the end point, which is the current point shifted by dx along the x-axis and dy along the y-axis. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands
Signature:
export declare function lineTo(dx: number, dy: number): string;
Parameters
Parameter |
Type |
Description |
dx |
number |
The relative x coordinate. |
dy |
number |
The relative y coordinate. |
Returns:
string
A string of the format ' l dx,dy '
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `utils.svgPaths.lineTo()` function generates an SVG path command to draw a line from the current point to a new point relative to the current position."],["It takes two arguments: `dx` (the change in x-coordinate) and `dy` (the change in y-coordinate), both in user coordinate units."],["The function returns a string representing the SVG path command for drawing the line, formatted as ' l dx,dy '."],["This command is used within SVG path definitions to create line segments, contributing to the overall shape or drawing within the SVG."]]],[]]