Skip to content

Gtk.GestureZoom

class — extends Gesture

Recognizes 2-finger pinch/zoom gestures.

Whenever the distance between both tracked sequences changes, the GestureZoom.scale-changed signal is emitted to report the scale factor.

Constructors

new

@classmethod
def new(cls) -> Gesture

Returns a newly created GtkGesture that recognizes pinch/zoom gestures.

Methods

get_scale_delta

def get_scale_delta(self) -> float

Gets the scale delta.

If gesture is active, this function returns the zooming difference since the gesture was recognized (hence the starting point is considered 1:1). If gesture is not active, 1 is returned.

Signals

scale-changed

def on_scale_changed(self, scale: float) -> None: ...

Emitted whenever the distance between both tracked sequences changes.