gradum-kit - v0.1.0
    Preparing search index...

    Class AnchorPoint

    AnchorPoint

    A position within a box, expressed either as one of the nine named Anchor values or as a free Point in percentages from -100 to 100. The two forms are interchangeable — assign whichever is convenient and read back whichever you need.

    Index
    • Parameters

      • Optionalanchor: Point | Anchor

        The starting position, as a named anchor or a point.

      Returns AnchorPoint

      Create an anchor point.

    • get value(): Point

      Returns Point

    • set value(value: Point | Anchor): void

      Parameters

      Returns void

      The anchor's position as a point. Assigning a named Anchor converts it; assigning anything unrecognized leaves the current value untouched.

    • get enum(): Anchor

      Returns Anchor

      The named Anchor nearest this position, snapping each axis to its closest edge or centre.

    • Function

      pointToEnum

      Parameters

      • value: Point

        The point to convert.

      Returns Anchor

      The nearest named anchor. Defaults to Anchor.Center for a missing point.

      Snap a point to the nearest named anchor. Each axis rounds to the closest of its two edges or its centre.

    • Function

      enumToPoint

      Parameters

      • value: Anchor

        The anchor to convert.

      Returns Point

      The corresponding point. Returns the origin for a missing anchor.

      Convert a named anchor to its point, in percentages from -100 to 100.