OffsetBase

interface OffsetBase
androidx.ui.engine.geometry.OffsetBase

Base class for Size and Offset, which are both ways to describe a distance as a two-dimensional axis-aligned vector.

Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.

The first argument sets the horizontal component, and the second the vertical component.

Summary

Public methods

open Boolean

Whether both components are finite (neither infinite nor NaN).

open Boolean

Greater-than-or-equal-to operator.

open Boolean

Greater-than operator.

open Boolean

Returns true if either component is Float.POSITIVE_INFINITY, and false if both are finite (or negative infinity, or NaN).

open Boolean

Less-than-or-equal-to operator.

open Boolean

Less-than operator.

Properties

abstract Float

abstract Float

Public methods

isFinite

open fun isFinite(): Boolean

Whether both components are finite (neither infinite nor NaN).

See also:

  • isInfinite, which returns true if either component is equal to positive infinity.

isGreaterOrEqThan

open fun isGreaterOrEqThan(other: OffsetBase): Boolean

Greater-than-or-equal-to operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are bigger than or equal to the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.

This is a partial ordering. It is possible for two values to be neither less, nor greater than, nor equal to, another.

isGreaterThan

open fun isGreaterThan(other: OffsetBase): Boolean

Greater-than operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are bigger than the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.

This is a partial ordering. It is possible for two values to be neither less, nor greater than, nor equal to, another.

isInfinite

open fun isInfinite(): Boolean

Returns true if either component is Float.POSITIVE_INFINITY, and false if both are finite (or negative infinity, or NaN).

This is different than comparing for equality with an instance that has both components set to Float.POSITIVE_INFINITY.

See also:

  • isFinite, which is true if both components are finite (and not NaN).

isLessOrEqThan

open fun isLessOrEqThan(other: OffsetBase): Boolean

Less-than-or-equal-to operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are smaller than or equal to the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.

This is a partial ordering. It is possible for two values to be neither less, nor greater than, nor equal to, another.

isLessThan

open fun isLessThan(other: OffsetBase): Boolean

Less-than operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are smaller than the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.

This is a partial ordering. It is possible for two values to be neither less, nor greater than, nor equal to, another.

Properties

dx

abstract val dx: Float

dy

abstract val dy: Float