Skip to content

Commit ada858e

Browse files
Roman DonchenkoOpenCV Buildbot
authored andcommitted
Merge pull request opencv#1429 from nzjrs:fix-sketcher
2 parents a4b3aa9 + 42faaa8 commit ada858e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

samples/python2/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ def on_mouse(self, event, x, y, flags, param):
9191
pt = (x, y)
9292
if event == cv2.EVENT_LBUTTONDOWN:
9393
self.prev_pt = pt
94+
elif event == cv2.EVENT_LBUTTONUP:
95+
self.prev_pt = None
96+
9497
if self.prev_pt and flags & cv2.EVENT_FLAG_LBUTTON:
9598
for dst, color in zip(self.dests, self.colors_func()):
9699
cv2.line(dst, self.prev_pt, pt, color, 5)
97100
self.dirty = True
98101
self.prev_pt = pt
99102
self.show()
100-
else:
101-
self.prev_pt = None
102103

103104

104105
# palette data from matplotlib/_cm.py

0 commit comments

Comments
 (0)