mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Merge pull request #1429 from nzjrs:fix-sketcher
This commit is contained in:
commit
ada858e1c0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user