projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0c575d
)
Fix mouse handling in python demos
author
John Stowers
<john.stowers@gmail.com>
Tue, 10 Sep 2013 11:35:57 +0000
(13:35 +0200)
committer
John Stowers
<john.stowers@gmail.com>
Fri, 20 Sep 2013 19:04:07 +0000
(21:04 +0200)
samples/python2/common.py
patch
|
blob
|
history
diff --git
a/samples/python2/common.py
b/samples/python2/common.py
index
e418b70
..
0ad811a
100755
(executable)
--- a/
samples/python2/common.py
+++ b/
samples/python2/common.py
@@
-91,14
+91,15
@@
class Sketcher:
pt = (x, y)
if event == cv2.EVENT_LBUTTONDOWN:
self.prev_pt = pt
+ elif event == cv2.EVENT_LBUTTONUP:
+ self.prev_pt = None
+
if self.prev_pt and flags & cv2.EVENT_FLAG_LBUTTON:
for dst, color in zip(self.dests, self.colors_func()):
cv2.line(dst, self.prev_pt, pt, color, 5)
self.dirty = True
self.prev_pt = pt
self.show()
- else:
- self.prev_pt = None
# palette data from matplotlib/_cm.py