Changeset 8876:fe26aa15a76b in orange


Ignore:
Timestamp:
09/01/11 13:16:29 (3 years ago)
Author:
anze <anze.staric@…>
Branch:
default
Convert:
b4b727dc7e8756f141084fe6f94f82b317d95566
Message:

Fixed zoom gesture.

File:
1 edited

Legend:

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

    r8874 r8876  
    11611161             
    11621162    def gestureEvent(self, event): 
    1163         qDebug('Gesture event with %d gestures' % (len(event.gestures()))) 
    11641163        for gesture in event.gestures(): 
    11651164            if gesture.state() == Qt.GestureStarted: 
     1165                self.current_gesture_scale = 1. 
    11661166                event.accept(gesture) 
    11671167                continue 
    11681168            elif gesture.gestureType() == Qt.PinchGesture: 
    1169                 self.zoom(gesture.centerPoint(), gesture.scaleFactor()) 
     1169                self.zoom(gesture.centerPoint(), gesture.scaleFactor()/self.current_gesture_scale ) 
     1170                self.current_gesture_scale = gesture.scaleFactor() 
    11701171            elif gesture.gestureType() == Qt.PanGesture: 
    11711172                self.pan(gesture.delta()) 
Note: See TracChangeset for help on using the changeset viewer.