FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RelativePoint

    struct · ferroui-base · v0.5.0

    struct RelativePoint
    

    Defines a point that may be defined relative to a containing element.

    View source

    Members

    point

    point: crate::Point
    

    The point.

    Source

    unit

    unit: RelativeUnit
    

    The unit of the point.

    Source

    TOP_LEFT

    const TOP_LEFT: RelativePoint
    

    A point at the top left of the containing element.

    Source

    CENTER

    const CENTER: RelativePoint
    

    A point at the center of the containing element.

    Source

    BOTTOM_RIGHT

    const BOTTOM_RIGHT: RelativePoint
    

    A point at the bottom right of the containing element.

    Source

    new

    const fn new(x: f64, y: f64, unit: RelativeUnit) -> Self
    

    Initializes a new instance of the RelativePoint structure.

    Source

    from_point

    const fn from_point(point: Point, unit: RelativeUnit) -> Self
    

    Initializes a new instance of the RelativePoint structure from a Point.

    Source

    equals

    fn equals(self: &Self, p: RelativePoint) -> bool
    

    Checks if the RelativePoint equals another point.

    Source

    to_pixels

    fn to_pixels(self: &Self, size: Size) -> Point
    

    Converts a RelativePoint into pixels, using size as the size of the visual the point is relative to.

    Source

    to_pixels_rect

    fn to_pixels_rect(self: &Self, rect: Rect) -> Point
    

    Converts a RelativePoint into pixels, using rect as the bounding rectangle the point is relative to.

    Source

    parse

    fn parse(s: &str) -> Result<Self, FormatError>
    

    Parses a RelativePoint string: "x, y" (absolute) or "x%, y%" (relative).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Transition<RelativePoint>
    • IInterpolator<RelativePoint>
    • From<RelativePoint>
    • ExpressionVariantValue
    • ServerPropertyValue
    • BatchValue
    • MarkupTyped
    • ValueTypeRegistration
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • FromStr
    • Display

    Availability

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