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
impl FollowerLayer
Sourcepub fn new(app: &mut App, link: Handle<LayerLink>) -> Handle<FollowerLayer>
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.
Sourcepub fn link(self: Handle<Self>, app: &App) -> Handle<LayerLink>
pub fn link(self: Handle<Self>, app: &App) -> Handle<LayerLink>
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.
Sourcepub fn show_when_unlinked(self: Handle<Self>, app: &App) -> bool
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.
Sourcepub fn set_show_when_unlinked(self: Handle<Self>, app: &mut App, value: bool)
pub fn set_show_when_unlinked(self: Handle<Self>, app: &mut App, value: bool)
See show_when_unlinked.
Sourcepub fn unlinked_offset(self: Handle<Self>, app: &App) -> Offset
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:
linked_offset, for when the layers are linked.
Sourcepub fn set_unlinked_offset(self: Handle<Self>, app: &mut App, value: Offset)
pub fn set_unlinked_offset(self: Handle<Self>, app: &mut App, value: Offset)
See unlinked_offset.
Sourcepub fn linked_offset(self: Handle<Self>, app: &App) -> Offset
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:
unlinked_offset, for when the layer is not linked.
Sourcepub fn set_linked_offset(self: Handle<Self>, app: &mut App, value: Offset)
pub fn set_linked_offset(self: Handle<Self>, app: &mut App, value: Offset)
See linked_offset.
Sourcepub fn get_last_transform(self: Handle<Self>, app: &App) -> Option<Matrix4>
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
impl ContainerLayer for FollowerLayer
Source§fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
Source§fn container_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ContainerLayerData
fn container_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ContainerLayerData
container_layer_data.Source§fn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
)
fn apply_transform( self: Handle<Self>, app: &App, child: Option<AnyLayer>, transform: &mut Matrix4, )
Source§const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable> = None
const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable> = None
extends OffsetLayer;
container_layer_accessors!(offset) sets it. Dart’s layer is OffsetLayer.Source§fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
ContainerLayer.Source§fn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
)
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
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
ContainerLayer.supportsRasterization.Source§fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
ContainerLayer.findAnnotations.Source§fn redepth_children(self: Handle<Self>, app: &mut App)
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)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
ContainerLayer.addToScene.Source§impl Layer for FollowerLayer
impl Layer for FollowerLayer
Source§fn always_needs_add_to_scene(self: Handle<Self>, _app: &App) -> bool
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>
const AS_CONTAINER: Option<fn() -> &'static ContainerLayerVTable>
extends ContainerLayer; layer_accessors!(container)
sets it. Dart’s layer is ContainerLayer.Source§fn layer_data(self: Handle<Self>, app: &App) -> &LayerData
fn layer_data(self: Handle<Self>, app: &App) -> &LayerData
layer ([layer_accessors!]).Source§fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData
fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData
layer_data.Source§fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
Scene.toImage. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)
fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)
Source§fn detach(self: Handle<Self>, app: &mut App)
fn detach(self: Handle<Self>, app: &mut App)
Source§fn redepth_children(self: Handle<Self>, app: &mut App)
fn redepth_children(self: Handle<Self>, app: &mut App)
Source§fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
local_position. Read moreSource§fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
Source§fn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
)
fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )
_fireCompositionCallbacks; ContainerLayer recurses into its children.