Skip to main content

FollowerLayer

Struct FollowerLayer 

Source
pub struct FollowerLayer { /* private fields */ }
Expand description

A composited layer that applies a transformation matrix to its children such that they are positioned to match a LeaderLayer.

If any of the ancestors of this layer have a degenerate matrix (e.g. scaling by zero), then the FollowerLayer will not be able to transform its child to the coordinate space of the LeaderLayer.

A linked_offset property can be provided to further offset the child layer from the leader layer, for example if the child is to follow the linked layer at a distance rather than directly overlapping it.

Implementations§

Source§

impl FollowerLayer

Source

pub fn new(app: &mut App, link: Handle<LayerLink>) -> Handle<FollowerLayer>

Creates a follower layer.

The unlinked_offset, linked_offset, and show_when_unlinked properties must be non-null before the compositing phase of the pipeline.

The link to the LeaderLayer.

The same object should be provided to a LeaderLayer that is earlier in the layer tree. When this layer is composited, it will apply a transform that moves its children to match the position of the LeaderLayer.

See link.

Source

pub fn show_when_unlinked(self: Handle<Self>, app: &App) -> bool

Whether to show the layer’s contents when the link does not point to a LeaderLayer.

When the layer is linked, children layers are positioned such that they have the same global position as the linked LeaderLayer.

When the layer is not linked, then: if show_when_unlinked is true, children are positioned as if the FollowerLayer was a ContainerLayer; if it is false, then children are hidden.

The show_when_unlinked property must be non-null before the compositing phase of the pipeline.

Source

pub fn set_show_when_unlinked(self: Handle<Self>, app: &mut App, value: bool)

Source

pub fn unlinked_offset(self: Handle<Self>, app: &App) -> Offset

Offset from parent in the parent’s coordinate system, used when the layer is not linked to a LeaderLayer.

The scene must be explicitly recomposited after this property is changed (as described at Layer).

The unlinked_offset property must be non-null before the compositing phase of the pipeline.

See also:

Source

pub fn set_unlinked_offset(self: Handle<Self>, app: &mut App, value: Offset)

Source

pub fn linked_offset(self: Handle<Self>, app: &App) -> Offset

Offset from the origin of the leader layer to the origin of the child layers, used when the layer is linked to a LeaderLayer.

The scene must be explicitly recomposited after this property is changed (as described at Layer).

The linked_offset property must be non-null before the compositing phase of the pipeline.

See also:

Source

pub fn set_linked_offset(self: Handle<Self>, app: &mut App, value: Offset)

Source

pub fn get_last_transform(self: Handle<Self>, app: &App) -> Option<Matrix4>

The transform that was used during the last composition phase.

If the link was not linked to a LeaderLayer, or if this layer has a degenerate matrix applied, then this will be None.

This method returns a new Matrix4 instance each time it is invoked.

Trait Implementations§

Source§

impl ContainerLayer for FollowerLayer

Source§

fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData

Mixin field access.
Source§

fn container_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ContainerLayerData

Source§

fn apply_transform( self: Handle<Self>, app: &App, child: Option<AnyLayer>, transform: &mut Matrix4, )

Applies the transform that would be applied when compositing the given child to the given matrix. Read more
Source§

const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable> = None

The offset table when this type extends OffsetLayer; container_layer_accessors!(offset) sets it. Dart’s layer is OffsetLayer.
Source§

fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer

Dart’s implicit upcast of a concrete layer to ContainerLayer.
Source§

fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )

ContainerLayer._fireCompositionCallbacks.
Source§

fn supports_rasterization(self: Handle<Self>, app: &App) -> bool

ContainerLayer.supportsRasterization.
Source§

fn dispose(self: Handle<Self>, app: &mut App)

ContainerLayer.dispose.
Source§

fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool

ContainerLayer.findAnnotations.
Source§

fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)

ContainerLayer.attach.
Source§

fn detach(self: Handle<Self>, app: &mut App)

ContainerLayer.detach.
Source§

fn redepth_children(self: Handle<Self>, app: &mut App)

ContainerLayer.redepthChildren.
Source§

fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)

ContainerLayer.addToScene.
Source§

impl Layer for FollowerLayer

Source§

fn always_needs_add_to_scene(self: Handle<Self>, _app: &App) -> bool

A FollowerLayer copies changes from a LeaderLayer that could be anywhere in the layer tree, and that leader layer could change without notifying the follower layer. Therefore a follower layer’s add_to_scene is always called.

Source§

const AS_CONTAINER: Option<fn() -> &'static ContainerLayerVTable>

The container table when this type extends ContainerLayer; layer_accessors!(container) sets it. Dart’s layer is ContainerLayer.
Source§

fn layer_data(self: Handle<Self>, app: &App) -> &LayerData

Dart’s base-class fields, held under the field layer ([layer_accessors!]).
Source§

fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData

Source§

fn supports_rasterization(self: Handle<Self>, app: &App) -> bool

Whether or not this layer, or any child layers, can be rasterized with Scene.toImage. Read more
Source§

fn dispose(self: Handle<Self>, app: &mut App)

Clears any retained resources that this layer holds. Read more
Source§

fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)

Mark this layer as attached to the given owner. Read more
Source§

fn detach(self: Handle<Self>, app: &mut App)

Mark this layer as detached from its owner. Read more
Source§

fn redepth_children(self: Handle<Self>, app: &mut App)

Adjust the depth of this node’s children, if any. Read more
Source§

fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool

Search this layer and its subtree for annotations of the searched type at the location described by local_position. Read more
Source§

fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)

Override this method to upload this layer to the engine.
Source§

fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )

Dart’s _fireCompositionCallbacks; ContainerLayer recurses into its children.
Source§

fn describe_clip_bounds(self: Handle<Self>, app: &App) -> Option<Rect>

Describes the clip that would be applied to contents of this layer, if any.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayerBase for T
where T: Layer,

Source§

fn dispose(self: Handle<Self>, app: &mut App)

Layer.dispose.
Source§

fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)

Layer.attach.
Source§

fn detach(self: Handle<Self>, app: &mut App)

Layer.detach.
Source§

fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )

Layer._fireCompositionCallbacks.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>