Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96bac89

Browse files
author
Will Silva
committed
poly_editor: if the last vertex is moved, also move the first vertex as they overlap
* this case is likely to not occur since it seems that the first vertex handle is rendered over the last vertex handle
1 parent 23ed8ff commit 96bac89

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

examples/event_handling/poly_editor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def motion_notify_callback(self, event):
143143
self.poly.xy[self._ind] = x, y
144144
if self._ind == 0:
145145
self.poly.xy[-1] = x, y
146+
elif self._ind == len(self.poly.xy) - 1:
147+
self.poly.xy[0] = x, y
146148
self.line.set_data(zip(*self.poly.xy))
147149

148150
self.canvas.restore_region(self.background)

0 commit comments

Comments
 (0)