Constructor
new VectorObject(path, fill, fill_rule, stroke, stroke_width, stroke_line_cap, stroke_line_join, stroke_miter_limit, stroke_dash_offset, stroke_dash_array, children, name, transform)
Creates a new VectorObject.
Name | Type | Description |
---|---|---|
path | Path2D | The Path2D of the vector object. |
fill | Style | The fill Style of the vector object. |
fill_rule | string | The fill rule of the vector object. |
stroke | Style | The stroke Style of the vector object. |
stroke_width | number | The stroke width of the vector object. |
stroke_line_cap | string | The stroke line cap of the vector object. |
stroke_line_join | string | The stroke line join of the vector object. |
stroke_miter_limit | number | The stroke miter limit of the vector object. |
stroke_dash_offset | number | The stroke dash offset of the vector object. |
stroke_dash_array | Array.<number> | The stroke dash array of the vector object. |
children | Array.<VectorObject> | The children of the vector object. |
name | string | | The name of the vector object. |
transform | TransformationMatrix | The TransformationMatrix of the vector object. |
- Source
Classes
Members
actual_path
Gets the Path2D with the applied TransformationMatrix.
- Source
center
Gets the center Point2D of the VectorObject.
- Source
children
Gets the children of the VectorObject.
- Source
fill
Gets the fill Style of the VectorObject.
- Source
fill_rule
Gets the fill rule of the VectorObject.
- Source
height
Gets the height of the VectorObject.
- Source
is_closed
Gets whether the VectorObject's path is closed.
- Source
name
Gets the name of the VectorObject.
- Source
num_children
Gets the number of children in the VectorObject.
- Source
num_curves
Gets the number of cubic bezier curves in the vector object.
- Source
num_points
Gets the number of points in the VectorObject's path.
- Source
path
Gets the Path2D of the VectorObject.
- Source
stroke
Gets the stroke Style of the VectorObject.
- Source
stroke_dash_array
Gets the stroke dash array of the VectorObject.
- Source
stroke_dash_offset
Gets the stroke dash offset of the VectorObject.
- Source
stroke_line_cap
Gets the stroke line cap of the VectorObject.
- Source
stroke_line_join
Gets the stroke line join of the VectorObject.
- Source
stroke_miter_limit
Gets the stroke miter limit of VectorObject.
- Source
stroke_width
Gets the stroke width of the VectorObject.
- Source
subpaths
Gets the subpaths of the VectorObject.
- Source
transform
Gets the transformation matrix of the VectorObject.
- Source
width
Gets the width of the VectorObject.
- Source
Methods
bounding_box(recursiveopt) → {BoundingBox|undefined}
Gets the BoundingBox of the VectorObject.
Name | Type | Attributes | Description |
---|---|---|---|
recursive | boolean | | <optional> | Whether to include the children of the vector object. |
- Source
The bounding box of the vector object.
- Type:
- BoundingBox |
undefined
clone() → {VectorObject}
Clones the vector object.
- Source
The cloned vector object.
- Type:
- VectorObject
get_children_by_names(names) → {Array.<VectorObject>}
Gets the children of the VectorObject with the given names.
Name | Type | Description |
---|---|---|
names | Array.<string> | The names of the children to get. |
- Source
The children with the given names.
- Type:
- Array.<VectorObject>
get_children_recursive(with_pointsopt) → {Array.<VectorObject>}
Gets the children of the VectorObject recursively.
Name | Type | Attributes | Description |
---|---|---|---|
with_points | boolean | | <optional> | Whether to include the children of the children of the vector object, default is false. |
- Source
The children of the vector object.
- Type:
- Array.<VectorObject>
get_critical_point(key_x, key_y, recursiveopt) → {Point2D|undefined}
Gets the critical Point2D of the VectorObject.
Name | Type | Attributes | Description |
---|---|---|---|
key_x | number | The x key of the critical point. If negative, the minimum x is returned. If positive, the maximum x is returned. If zero, the center x is returned. | |
key_y | number | The y key of the critical point. If negative, the minimum y is returned. If positive, the maximum y is returned. If zero, the center y is returned. | |
recursive | boolean | | <optional> | Whether to include the children of the vector object. |
- Source
The critical point of the vector object.
- Type:
- Point2D |
undefined
slice_children(start, end) → {Array.<VectorObject>}
Slices the VectorObject's children.
Name | Type | Description |
---|---|---|
start | number | The start index of the children to slice. |
end | number | The end index of the children to slice. |
- Source
The sliced children of the vector object.
- Type:
- Array.<VectorObject>
(static) default_vector_object() → {VectorObject}
Creates a new empty VectorObject.
- Source
A new empty vector object.
- Type:
- VectorObject