Skip to content

Commit 96b9ada

Browse files
committed
Fixing issue #24
1 parent 8042ec5 commit 96b9ada

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

run.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -251,24 +251,24 @@ def mouse_listener(event, x, y, flags, param):
251251
if prev_was_double_click:
252252
#print("Finish double click")
253253
prev_was_double_click = False
254-
else:
255-
#print("Normal left click")
256-
is_mouse_inside_delete_button = mouse_inside_delete_button()
257-
if point_1[0] is -1:
258-
if is_bbox_selected and is_mouse_inside_delete_button:
259-
# the user wants to delete the bbox
260-
#print("Delete bbox")
261-
delete_selected_bbox()
262-
else:
263-
is_bbox_selected = False
264-
# first click (start drawing a bounding box or delete an item)
265-
point_1 = (x, y)
254+
255+
#print("Normal left click")
256+
is_mouse_inside_delete_button = mouse_inside_delete_button()
257+
if point_1[0] is -1:
258+
if is_bbox_selected and is_mouse_inside_delete_button:
259+
# the user wants to delete the bbox
260+
#print("Delete bbox")
261+
delete_selected_bbox()
266262
else:
267-
# minimal size for bounding box to avoid errors
268-
threshold = 20
269-
if abs(x - point_1[0]) > threshold or abs(y - point_1[1]) > threshold:
270-
# second click
271-
point_2 = (x, y)
263+
is_bbox_selected = False
264+
# first click (start drawing a bounding box or delete an item)
265+
point_1 = (x, y)
266+
else:
267+
# minimal size for bounding box to avoid errors
268+
threshold = 20
269+
if abs(x - point_1[0]) > threshold or abs(y - point_1[1]) > threshold:
270+
# second click
271+
point_2 = (x, y)
272272

273273

274274
def is_mouse_inside_points(x1, y1, x2, y2):

0 commit comments

Comments
 (0)