Changeset 8573:1ec6904ccead in orange


Ignore:
Timestamp:
08/02/11 13:07:00 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
170fca57825a55650cc483cbb4f696ae6058532b
Message:

Implement mouse-wheel zoom

File:
1 edited

Legend:

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

    r8572 r8573  
    911911            return False 
    912912             
     913    def wheelEvent(self, event): 
     914        point = self.mapToScene(event.pos()) 
     915        d = event.delta() / 120.0 
     916        self.zoom(point, pow(2,d)) 
     917             
    913918    def mouseDoubleClickEvent(self, event): 
    914919        ## We don't want this events to propagate to the scene 
     
    947952        r.moveCenter(point) 
    948953         
    949         self.ensure_inside(r, old_rect) 
     954        self.ensure_inside(r, self.graph_area) 
    950955         
    951956        return r 
Note: See TracChangeset for help on using the changeset viewer.