@@ -1679,7 +1679,8 @@ def press(self, event):
1679
1679
if not self .RetinaFix :
1680
1680
self .wxoverlay = wx .Overlay ()
1681
1681
else :
1682
- self .savedRetinaImage = self .canvas .copy_from_bbox (self .canvas .figure .gca ().bbox )
1682
+ self .savedRetinaImage = self .canvas .copy_from_bbox (
1683
+ self .canvas .figure .gca ().bbox )
1683
1684
self .zoomStartX = event .xdata
1684
1685
self .zoomStartY = event .ydata
1685
1686
@@ -1697,21 +1698,22 @@ def release(self, event):
1697
1698
self .prevZoomRect = None
1698
1699
1699
1700
def draw_rubberband (self , event , x0 , y0 , x1 , y1 ):
1700
- if self .RetinaFix :
1701
- # wx.DCOverlay does not work properly on Macs with Retina displays
1702
- # for Macs, use the following code instead.
1703
- rubberBandColor = '#C0C0FF' # or load from config?
1701
+ if self .RetinaFix : # On Macs, use the following code
1702
+ # wx.DCOverlay does not work properly on Retina displays.
1703
+ rubberBandColor = '#C0C0FF'
1704
1704
if self .prevZoomRect :
1705
1705
self .prevZoomRect .pop (0 ).remove ()
1706
1706
self .canvas .restore_region (self .savedRetinaImage )
1707
- X0 ,X1 ,Y0 ,Y1 = self .zoomStartX ,event .xdata ,self .zoomStartY ,event .ydata
1707
+ X0 ,X1 = self .zoomStartX ,event .xdata
1708
+ Y0 ,Y1 = self .zoomStartY ,event .ydata
1708
1709
lineX = (X0 , X0 , X1 , X1 , X0 )
1709
1710
lineY = (Y0 , Y1 , Y1 , Y0 , Y0 )
1710
- self .prevZoomRect = self .canvas .figure .gca ().plot (lineX ,lineY ,'-' ,color = rubberBandColor )
1711
+ self .prevZoomRect = self .canvas .figure .gca ().plot (
1712
+ lineX ,lineY ,'-' ,color = rubberBandColor )
1711
1713
self .canvas .figure .gca ().draw_artist (self .prevZoomRect [0 ])
1712
1714
self .canvas .blit (self .canvas .figure .gca ().bbox )
1713
1715
return
1714
-
1716
+
1715
1717
# Use an Overlay to draw a rubberband-like bounding box.
1716
1718
1717
1719
dc = wx .ClientDC (self .canvas )
0 commit comments