FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionViewBox

    struct · ferroui-base · v0.5.0

    struct CompositionViewBox
    

    The area of the shape coordinates a shape visual or a geometric clip shows (WinUI Microsoft.UI.Composition.CompositionViewBox): the rectangle (offset, size) of the shapes is mapped onto the visual by stretch and placed by the alignment ratios, as a surface brush lays out its surface. Offset, Size and the ratios are animatable.

    Deviation (winui-composition.md): what is outside the mapped view box is clipped (the port's reading of WinUI); a view box whose size is zero maps nothing (the shapes are drawn as if there were no view box).

    View source

    Members

    compositor

    fn compositor(self: &Self) -> &Rc<Compositor>
    

    Source

    object

    fn object(self: &Self) -> &CompositionObject
    

    The embedded CompositionObject.

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    dispose

    fn dispose(self: &Self)
    

    Source

    horizontal_alignment_ratio

    fn horizontal_alignment_ratio(self: &Self) -> f32
    

    The part of the free horizontal space left of the mapped view box (0 left, 0.5 centre, 1 right; default 0.5).

    Source

    set_horizontal_alignment_ratio

    fn set_horizontal_alignment_ratio(self: &Self, value: f32)
    

    Source

    offset

    fn offset(self: &Self) -> Vector
    

    The top left corner of the view box, in shape coordinates.

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector)
    

    Source

    size

    fn size(self: &Self) -> Vector
    

    The size of the view box, in shape coordinates.

    Source

    set_size

    fn set_size(self: &Self, value: Vector)
    

    Source

    stretch

    fn stretch(self: &Self) -> CompositionStretch
    

    How the view box is scaled onto the visual (default Fill).

    Source

    set_stretch

    fn set_stretch(self: &Self, value: CompositionStretch)
    

    Source

    vertical_alignment_ratio

    fn vertical_alignment_ratio(self: &Self) -> f32
    

    The part of the free vertical space above the mapped view box (0 top, 0.5 centre, 1 bottom; default 0.5).

    Source

    set_vertical_alignment_ratio

    fn set_vertical_alignment_ratio(self: &Self, value: f32)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • CompositionViewBoxHooks
    • IRegisterForSerialization
    • ICompositionObjectHost
    • ICompositionObjectAnimations
    • AsCompositionObject
    • ICompositionObject
    • ICompositorSerializable

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.