def OnLeftUp(self, event): if event.LeftUp() and not self.StartRBBox is None: self.PrevRBBox = None EndRBBox = event.GetPosition() StartRBBox = self.StartRBBox # if mouse has moved less that ten pixels, don't use the box. if ( abs(StartRBBox[0] - EndRBBox[0]) > 10 and abs(StartRBBox[1] - EndRBBox[1]) > 10 ): EndRBBox = self.Canvas.PixelToWorld(EndRBBox) StartRBBox = self.Canvas.PixelToWorld(StartRBBox) self.Canvas.ZoomToBB( BBox.fromPoints(N.r_[EndRBBox,StartRBBox]) ) else: Center = self.Canvas.PixelToWorld(StartRBBox) self.Canvas.Zoom(1.5,Center) self.StartRBBox = None