pub trait OffsetLayerMixin: ContainerLayer {
// Required methods
fn offset_layer_data(self: Handle<Self>, app: &App) -> &OffsetLayerData;
fn offset_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut OffsetLayerData;
// Provided methods
fn as_offset_layer(self: Handle<Self>) -> AnyOffsetLayer { ... }
fn offset(self: Handle<Self>, app: &App) -> Offset { ... }
fn set_offset(self: Handle<Self>, app: &mut App, value: Offset) { ... }
fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool { ... }
fn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
) { ... }
fn add_to_scene(
self: Handle<Self>,
app: &mut App,
builder: &mut SceneBuilder,
) { ... }
}Expand description
A layer that is displayed at an offset from its parent layer.
Offset layers are key to efficient repainting because they are created by repaint boundaries
in the RenderObject tree (see RenderObject.isRepaintBoundary). When a render object that
is a repaint boundary is asked to paint at given offset in a PaintingContext, the render
object first checks whether it needs to repaint itself. If not, it reuses its existing
OffsetLayer (and its entire subtree) by mutating its offset property, cutting off the
paint walk.
Flutter’s OffsetLayer is a concrete class that TransformLayer, OpacityLayer and
ImageFilterLayer extend: the bodies are here, OffsetLayer is the concrete leaf.
Required Methods§
Sourcefn offset_layer_data(self: Handle<Self>, app: &App) -> &OffsetLayerData
fn offset_layer_data(self: Handle<Self>, app: &App) -> &OffsetLayerData
Mixin field access.
Sourcefn offset_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut OffsetLayerData
fn offset_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut OffsetLayerData
See offset_layer_data.
Provided Methods§
Sourcefn as_offset_layer(self: Handle<Self>) -> AnyOffsetLayer
fn as_offset_layer(self: Handle<Self>) -> AnyOffsetLayer
Dart’s implicit upcast of a concrete layer to OffsetLayer.
Sourcefn offset(self: Handle<Self>, app: &App) -> Offset
fn offset(self: Handle<Self>, app: &App) -> Offset
Offset from parent in the parent’s coordinate system.
Sourcefn 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
OffsetLayer.findAnnotations.
Sourcefn 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, )
OffsetLayer.applyTransform.
Sourcefn 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)
OffsetLayer.addToScene.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".