svg_path_editor.sub_path_bounds#
Functions#
|
Find the index of the nearest preceding |
|
Find the index of the next |
|
Compute the half-open slice bounds of the subpath containing a given item. |
Module Contents#
- svg_path_editor.sub_path_bounds.find_previous_move_to(svg, index)[source]#
Find the index of the nearest preceding
Mcommand.- Parameters:
svg (SvgPath) – Path whose items are inspected.
index (int) – Starting index (inclusive) from which to search backwards.
- Returns:
Index of the previous
Mitem, or0if none is found.- Return type:
int
- svg_path_editor.sub_path_bounds.find_next_move_to(svg, index)[source]#
Find the index of the next
Mcommand after the given item.- Parameters:
svg (SvgPath) – Path whose items are inspected.
index (int) – Starting index (exclusive) from which to search forwards.
- Returns:
Index of the next
Mitem, orlen(svg.path)if none is found.- Return type:
int
- svg_path_editor.sub_path_bounds.get_sub_path_bounds(svg, index=None)[source]#
Compute the half-open slice bounds of the subpath containing a given item.
- Parameters:
svg (SvgPath) – Path whose subpath bounds are computed.
index (int | None) – Item index inside the target subpath, or
Noneto get bounds of the entire path.
- Returns:
(start, end)indices suitable for slicingsvg.path[start:end].- Return type:
tuple[int, int]