pub struct Placement {
pub rect: Rect,
pub mutators: Vec<Mutator>,
}Expand description
Where one frame puts one composition layer: what a host compares to tell a frame worth presenting from one it already shows.
Fields§
§rect: RectThe layer’s rectangle, in the coordinates the transforms among mutators lead to.
mutators: Vec<Mutator>What the containers above the layer do to it, the outermost first: Flutter’s
MutatorsStack. A view’s scene begins with its root transform, which takes the
framework’s logical pixels to the view’s physical ones.
Implementations§
Source§impl Placement
impl Placement
Sourcepub fn transform(&self) -> Matrix4
pub fn transform(&self) -> Matrix4
Every transform above the layer in one: Flutter’s transformMatrix, which takes rect’s
coordinates to the view’s pixels.
Sourcepub fn scale(&self) -> f64
pub fn scale(&self) -> f64
How many of the view’s pixels one unit of the layer’s own coordinates spans along its
own horizontal: the scale of every transform above it, the root’s device pixel ratio
among them. A producer draws its buffers at the device pixel ratio, so a host shows a
buffer at scale / device_pixel_ratio of its size.
Sourcepub fn bounds(&self) -> Rect
pub fn bounds(&self) -> Rect
The box around the layer under every transform above it, in the view’s pixels.
Sourcepub fn visible_bounds(&self) -> Rect
pub fn visible_bounds(&self) -> Rect
bounds cut down to the bounds of every clip above the layer: what a
compositor that clips by rectangles alone shows of it. An empty rectangle on the clip’s
nearest edge when nothing shows.