- Declared in: RT.Coordinates.Vertex
- Virtual
Declaration
public virtual string SvgPathFragment(
Vertex from,
Func<Vertex, PointD> getVertexPoint,
Func<double, string> r,
bool isLast
)
Summary
Provides a means for derived classes to override the SVG path generation for a line segment from another
vertex
from to this one.
Parameters
Vertex | from |
Previous vertex along the path. |
Func<Vertex, PointD> | getVertexPoint |
Function to obtain the 2D coordinates of the vertex. Overrides must use this instead of calling Vertex.Point directly to allow client code to use SvgInstructions.GetVertexPoint to override
the positions of vertices. |
Func<double, string> | r |
Use this to turn floating-point values into strings. This will respect the user’s SvgInstructions.Precision instruction. |
bool | isLast | true if we are generating a closed path and this is the last invocation. This vertex is therefore the
first in the path, as the path is returning to its starting position. |
Returns
A string that can be inserted in the
d
attribute of an SVG
<path>
element.
Remarks
The implementation must assume that the SVG path is already at the
from vertex and return
only the part of the path that leads to the current vertex. For example, the default implementation returns
$"L{r(PointD.X)} {r(PointD.Y)}"
and
does not reference
from at all.