File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1247,12 +1247,12 @@ def ignore(self, event):
1247
1247
# boundaries.
1248
1248
if event .button == self .eventpress .button and event .inaxes != self .ax :
1249
1249
(xdata , ydata ) = self .ax .transData .inverted ().transform_point ((event .x , event .y ))
1250
- xlim = self .ax .get_xlim ()
1251
- ylim = self .ax .get_ylim ()
1252
- if xdata < xlim [ 0 ]: xdata = xlim [ 0 ]
1253
- if xdata > xlim [ 1 ]: xdata = xlim [ 1 ]
1254
- if ydata < ylim [ 0 ]: ydata = ylim [ 0 ]
1255
- if ydata > ylim [ 1 ]: ydata = ylim [ 1 ]
1250
+ x0 , x1 = self .ax .get_xbound ()
1251
+ y0 , y1 = self .ax .get_ybound ()
1252
+ xdata = max ( x0 , xdata )
1253
+ xdata = min ( x1 , xdata )
1254
+ ydata = max ( y0 , ydata )
1255
+ ydata = min ( y1 , ydata )
1256
1256
event .xdata = xdata
1257
1257
event .ydata = ydata
1258
1258
return False
You can’t perform that action at this time.
0 commit comments