pixso.vectorEditor
The pixso.vectorEditor object is a vector editor that provides methods for entering and exiting vector editing mode, selecting and setting vector vertices, control points, paths, etc.
enterVertorEditMode
- Type: enterVertorEditMode(node: VectorNode|LineNode|RectangleNode|EllipseNode|StarNode|PolygonNode): void
Select a vector layer to enter vector editing mode.
exitVertorEditMode
- Type: exitVertorEditMode(): void
Exit vector editing mode.
addVertex
You need to switch to the pen tool first before calling this interface.
- Type: addVertex(vector: Vector): void
Add a vector vertex.
deleteVertex
Used in vector editing mode.
- Type: deleteVertex(index: number): void
Delete a vector vertex.
selectVertex
Used in vector editing mode.
- Type: selectVertex(index: number): void
Select a vector vertex.
setSelectedVertexPosition
To use it in vector editing mode, you need to select the vector vertices first.
- Type: setSelectedVertexPosition(vector: Vector): void
Changes the coordinates of selected vector vertex.
setSelectedVertexMirrorType
To use in vector editing mode, you need to select the vector vertices first.
- Type: setSelectedVertexMirrorType(handleMirroring: HandleMirroring): void
Changes the handleMirroring of selected vector vertices.
setSelectedVertexCornerRadius
To use in vector editing mode, you need to select the vector vertices first.
- Type: setSelectedVertexCornerRadius(cornerRadius: number): void
Changes the corner radius of selected vector vertices.
getControlPoints
To use in vector editing mode, you need to select the vector vertices first.
- Type: getControlPoints(): Vector[]
Get all control points of the currently selected vector vertex.
selectControlPoint
To use in vector editing mode, you need to select the vector vertices first.
- Type: selectControlPoint(index: number): void
Select a control point of the currently selected vector vertex.
setSelectedControlPointPosition
To use in vector editing mode, you need to select the vector vertices first.
- Type: setSelectedControlPointPosition(vector: Vector): void
Change the coordinates of the currently selected control point.
addSegment
Used in vector editing mode.
- Type: addSegment(startVertexIndex: number, endVertexIndex: number): void
Add a vector segment.
deleteSegment
Used in vector editing mode.
- Type: deleteSegment(index: number): void
Delete a vector segment.
selectSegment
Used in vector editing mode.
- Type: selectSegment(index: number): void
Select a vector segment.