pygui: fixed issue with moving text shapes

This commit is contained in:
Blake Harnden 2020-05-17 00:11:28 -07:00
parent 41df8a57b8
commit 8979c86187

View file

@ -157,10 +157,11 @@ class Shape:
original_position = self.canvas.coords(self.id)
self.canvas.move(self.id, x_offset, y_offset)
coords = self.canvas.coords(self.id)
if self.shape_type == ShapeType.TEXT:
coords = coords * 2
if not self.canvas.valid_position(*coords):
self.canvas.coords(self.id, original_position)
return
self.canvas.move_selection(self.id, x_offset, y_offset)
if self.text_id is not None:
self.canvas.move(self.text_id, x_offset, y_offset)