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

Method move_figure

PySimpleGUI/PySimpleGUI.py:6670–6687  ·  view source on GitHub ↗

Moves a previously drawn figure using a "delta" from current position :param figure: Previously obtained figure-id. These are returned from all Draw methods :type figure: (id) :param x_direction: delta to apply to position in the X direction :type

(self, figure, x_direction, y_direction)

Source from the content-addressed store, hash-verified

6668 self._TKCanvas2.move('all', shift_amount[0], shift_amount[1])
6669
6670 def move_figure(self, figure, x_direction, y_direction):
6671 """
6672 Moves a previously drawn figure using a "delta" from current position
6673
6674 :param figure: Previously obtained figure-id. These are returned from all Draw methods
6675 :type figure: (id)
6676 :param x_direction: delta to apply to position in the X direction
6677 :type x_direction: int | float
6678 :param y_direction: delta to apply to position in the Y direction
6679 :type y_direction: int | float
6680 """
6681 zero_converted = self._convert_xy_to_canvas_xy(0, 0)
6682 shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
6683 shift_amount = (shift_converted[0] - zero_converted[0], shift_converted[1] - zero_converted[1])
6684 if figure is None:
6685 print('* move_figure warning - your figure is None *')
6686 return None
6687 self._TKCanvas2.move(figure, shift_amount[0], shift_amount[1])
6688
6689 def relocate_figure(self, figure, x, y):
6690 """

Callers 5

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

moveMethod · 0.45

Tested by

no test coverage detected