From cd9d695f9d34aee43430381e4cfb13303e5b860b Mon Sep 17 00:00:00 2001 From: Alexander Mordvintsev Date: Tue, 20 Sep 2011 11:49:24 +0000 Subject: [PATCH] fix in RectSelector --- samples/python2/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/python2/common.py b/samples/python2/common.py index 43d22b3..f2e74fc 100644 --- a/samples/python2/common.py +++ b/samples/python2/common.py @@ -139,10 +139,11 @@ class RectSelector: if x1-x0 > 0 and y1-y0 > 0: self.drag_rect = (x0, y0, x1, y1) else: - if self.drag_rect: - self.callback(self.drag_rect) + rect = self.drag_rect self.drag_start = None self.drag_rect = None + if rect: + self.callback(rect) def draw(self, vis): if not self.drag_rect: return -- 2.7.4