MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / get_bounding_box

Method get_bounding_box

PySimpleGUI/PySimpleGUI.py:6743–6755  ·  view source on GitHub ↗

Given a figure, returns the upper left and lower right bounding box coordinates :param figure: a previously drawing figure :type figure: object :return: upper left x, upper left y, lower right x, lower right y :rtype: Tuple[int, int, int, int]

(self, figure)

Source from the content-addressed store, hash-verified

6741 return ids
6742
6743 def get_bounding_box(self, figure):
6744 """
6745 Given a figure, returns the upper left and lower right bounding box coordinates
6746
6747 :param figure: a previously drawing figure
6748 :type figure: object
6749 :return: upper left x, upper left y, lower right x, lower right y
6750 :rtype: Tuple[int, int, int, int] | Tuple[float, float, float, float]
6751 """
6752 box = self.TKCanvas.bbox(figure)
6753 top_left = self._convert_canvas_xy_to_xy(box[0], box[1])
6754 bottom_right = self._convert_canvas_xy_to_xy(box[2], box[3])
6755 return top_left, bottom_right
6756
6757 def change_coordinates(self, graph_bottom_left, graph_top_right):
6758 """

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected