About all my projects
Gnome::Gtk4::GestureZoom

Gnome::Gtk4::GestureZoom

Description

Gnome::Gtk4::GestureZoom is a Gnome::Gtk4::Gesture for 2-finger pinch/zoom gestures.

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

Uml Diagram

No caption

Class initialization

new

:native-object

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )

new-gesturezoom

Returns a newly created Gnome::Gtk4::Gesture that recognizes pinch/zoom gestures.

method new-gesturezoom ( --> Gnome::Gtk4::GestureZoom )

Methods

get-scale-delta

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.

method get-scale-delta (--> Num )

Return value; the scale delta.

Signals

scale-changed

Emitted whenever the distance between both tracked sequences changes.

method handler (
  gdouble $scale,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureZoom :$_widget,
  *%user-options
)
  • $scale; Scale delta, taking the initial state as 1:1.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureZoom object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.