File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -178,16 +178,22 @@ def snap_rectangle_to_edges(self, event):
178
178
self .drag_motion (event )
179
179
180
180
def check_pick (self , event ):
181
+ pick_found = False
181
182
for templates in self .interactive_templates .values ():
182
183
for it in templates :
183
184
it .static_mode = True
184
185
transformed_click = it .template .get_transform ().transform (
185
186
(event .xdata , event .ydata ))
186
- if it .template .contains_point (transformed_click ):
187
+ if (not pick_found and
188
+ it .template .contains_point (transformed_click ) and
189
+ event .inaxes .get_title () == it .detector ):
187
190
if self .interactive_template :
188
191
self .interactive_template .disconnect ()
189
192
self .interactive_template = it
190
193
self .interactive_template .static_mode = False
194
+ self .interactive_template .on_press (event )
195
+ pick_found = True
196
+ return pick_found
191
197
192
198
def button_pressed (self , event ):
193
199
if self .image_mode not in (ViewType .raw , ViewType .polar ):
@@ -199,9 +205,10 @@ def button_pressed(self, event):
199
205
200
206
if event .button == 1 :
201
207
# Determine if selecting an existing template or drawing a new one
202
- self .check_pick (event )
208
+ pick_found = self .check_pick (event )
203
209
204
- if (self .interactive_template and
210
+ if (pick_found or
211
+ self .interactive_template and
205
212
not self .interactive_template .static_mode ):
206
213
return
207
214
You can’t perform that action at this time.
0 commit comments