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

Skip to content

Commit 312d26a

Browse files
authored
Fix minor bug in vertex insert
1 parent 2f63513 commit 312d26a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/event_handling/poly_editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def key_press_callback(self, event):
127127
d = dist_point_to_segment(p, s0, s1)
128128
if d <= self.epsilon:
129129
self.poly.xy = np.array(
130-
list(self.poly.xy[:i]) +
130+
list(self.poly.xy[:i + 1]) +
131131
[(event.xdata, event.ydata)] +
132-
list(self.poly.xy[i:]))
132+
list(self.poly.xy[i + 1:]))
133133
self.line.set_data(zip(*self.poly.xy))
134134
break
135135

0 commit comments

Comments
 (0)