Gnome::Gtk4::GestureZoom
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
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 =for image :src<asset_files/images/plantuml/GestureZoom.png> :width<70%> :class<inline>
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
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]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
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.
#------------------------------------------------------------------------------- #--[Signal Documentation]------------------------------------------------------- #-------------------------------------------------------------------------------
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.