DevelopmentInstallUbuntu: scroll_wx_mpl.patch

File scroll_wx_mpl.patch, 1.2 kB (added by jonathan.taylor, 8 months ago)

Patch of matplotlib to fix a wx bug from Chris Burns.

  • lib/matplotlib/backends/backend_wx.py

    old new  
    11741174        FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt) 
    11751175 
    11761176    def _onMouseWheel(self, evt): 
    1177         # TODO: implement mouse wheel handler 
    1178         pass 
     1177        """Handle mousewheel events.""" 
     1178        x = evt.GetX() 
     1179        y = self.figure.bbox.height() - evt.GetY() 
     1180        if evt.GetWheelRotation() > 0: 
     1181            direction = 'up' 
     1182        else: 
     1183            direction = 'down' 
     1184        evt.Skip() 
     1185        FigureCanvasBase.scroll_event(self, x, y, direction, guiEvent=evt) 
    11791186 
    11801187    def _onMotion(self, evt): 
    11811188        """Start measuring on an axis.""" 
     
    13931400        self.canvas.figure.add_axobserver(notify_axes_change) 
    13941401 
    13951402        def showfig(*args): 
    1396             figwin.frame.Show() 
    1397             figwin.canvas.realize() 
    1398             figwin.canvas.draw() 
     1403            self.frame.Show() 
     1404            self.canvas.realize() 
     1405            self.canvas.draw() 
    13991406 
    14001407        # attach a show method to the figure 
    14011408        self.canvas.figure.show = showfig