svg_path_editor.sub_path_bounds =============================== .. py:module:: svg_path_editor.sub_path_bounds Functions --------- .. autoapisummary:: svg_path_editor.sub_path_bounds.find_previous_move_to svg_path_editor.sub_path_bounds.find_next_move_to svg_path_editor.sub_path_bounds.get_sub_path_bounds Module Contents --------------- .. py:function:: find_previous_move_to(svg, index) Find the index of the nearest preceding ``M`` command. :param svg: Path whose items are inspected. :param index: Starting index (inclusive) from which to search backwards. :return: Index of the previous ``M`` item, or ``0`` if none is found. .. py:function:: find_next_move_to(svg, index) Find the index of the next ``M`` command after the given item. :param svg: Path whose items are inspected. :param index: Starting index (exclusive) from which to search forwards. :return: Index of the next ``M`` item, or ``len(svg.path)`` if none is found. .. py:function:: get_sub_path_bounds(svg, index = None) Compute the half-open slice bounds of the subpath containing a given item. :param svg: Path whose subpath bounds are computed. :param index: Item index inside the target subpath, or ``None`` to get bounds of the entire path. :return: ``(start, end)`` indices suitable for slicing ``svg.path[start:end]``.