Trait ZoomActionExt

Source
pub trait ZoomActionExt: 'static {
    // Required methods
    fn get_focal_point(&self) -> Point;
    fn get_transformed_focal_point(&self) -> Point;
    fn get_zoom_axis(&self) -> ZoomAxis;
    fn set_zoom_axis(&self, axis: ZoomAxis);
    fn connect_zoom<F: Fn(&Self, &Actor, &Point, f64) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_property_zoom_axis_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
}
Expand description

Trait containing all ZoomAction methods.

§Implementors

ZoomAction

Required Methods§

Source

fn get_focal_point(&self) -> Point

Retrieves the focal point of the current zoom

§point

a Point

Source

fn get_transformed_focal_point(&self) -> Point

Retrieves the focal point relative to the actor’s coordinates of the current zoom

§point

a Point

Source

fn get_zoom_axis(&self) -> ZoomAxis

Retrieves the axis constraint set by ZoomActionExt::set_zoom_axis

§Returns

the axis constraint

Source

fn set_zoom_axis(&self, axis: ZoomAxis)

Restricts the zooming action to a specific axis

§axis

the axis to constraint the zooming to

Source

fn connect_zoom<F: Fn(&Self, &Actor, &Point, f64) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::zoom signal is emitted for each series of touch events that change the distance and focal point between the touch points.

The default handler of the signal will call ActorExt::set_scale on actor using the ratio of the first distance between the touch points and the current distance. To override the default behaviour, connect to this signal and return false.

§actor

the Actor attached to the action

§focal_point

the focal point of the zoom

§factor

the initial distance between the 2 touch points

§Returns

true if the zoom should continue, and false if the zoom should be cancelled.

Source

fn connect_property_zoom_axis_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§