Changeset 8614:e86cb3fee32a in orange


Ignore:
Timestamp:
08/05/11 12:21:49 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
493b0274b4538e2f20b798850825b73b52e1f1ed
Message:

RMB now revert to the previous zoom state instead of just zooming out

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot.py

    r8613 r8614  
    213213        self._zoom_rect = None 
    214214        self._zoom_transform = QTransform() 
     215        self.zoom_stack = [] 
    215216        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) 
    216217        self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) 
     
    877878                self.zoom_in(point) 
    878879            elif event.button() == Qt.RightButton: 
    879                 self.zoom_out(point) 
     880                self.zoom_back() 
    880881            else: 
    881882                return False 
     
    12241225    def zoom_to_rect(self, rect): 
    12251226        self.ensure_inside(rect, self.graph_area) 
    1226         qDebug('Zoom to rect, final state is' + repr(rect)) 
     1227        self.zoom_stack.append(self.zoom_rect) 
    12271228        self.animate(self, 'zoom_rect', rect) 
     1229         
     1230    def zoom_back(self): 
     1231        if self.zoom_stack: 
     1232            rect = self.zoom_stack.pop() 
     1233            self.animate(self, 'zoom_rect', rect) 
    12281234 
    12291235    def reset_zoom(self): 
Note: See TracChangeset for help on using the changeset viewer.