Offset
@Immutable data class Offset
kotlin.Any  
↳  androidx.ui.geometry.Offset 
An immutable 2D floatingpoint offset.
Generally speaking, Offsets can be interpreted in two ways:
 As representing a point in Cartesian space a specified distance from a separatelymaintained origin. For example, the topleft position of children in the RenderBox protocol is typically represented as an Offset from the top left of the parent box.
 As a vector that can be applied to coordinates. For example, when painting a RenderObject, the parent is passed an Offset from the screen's origin which it can add to the offsets of its children to find the Offset from the screen's origin to each of the children.
Because a particular Offset can be interpreted as one sense at one time then as the other sense at a later time, the same class is used for both senses.
See also:
 Size, which represents a vector describing the size of a rectangle.
Creates an offset. The first argument sets x, the horizontal component, and the second sets y, the vertical component.
Summary
Public constructors  

An immutable 2D floatingpoint offset. 
Public methods  

Offset 
Returns a copy of this Offset instance optionally overriding the x or y parameter 
operator Offset 
Division operator. 
Float 
The magnitude of the offset. 
Float 
The square of the magnitude of the offset. 
Boolean 
isValid() 
operator Offset 
Binary subtraction operator. 
operator Offset 
Binary addition operator. 
operator Offset 
Modulo (remainder) operator. 
operator Offset 
Multiplication operator. 
String 
toString() 
operator Offset 
Unary negation operator. 
Extension functions  

From androidx.ui.unit

Properties  

Float  
Float 
Companion properties  

Offset 
An offset with infinite x and y components. 
Offset 
An offset with zero magnitude. 
Public constructors
<init>
Offset(packedValue: Long)
An immutable 2D floatingpoint offset.
Generally speaking, Offsets can be interpreted in two ways:
 As representing a point in Cartesian space a specified distance from a separatelymaintained origin. For example, the topleft position of children in the RenderBox protocol is typically represented as an Offset from the top left of the parent box.
 As a vector that can be applied to coordinates. For example, when painting a RenderObject, the parent is passed an Offset from the screen's origin which it can add to the offsets of its children to find the Offset from the screen's origin to each of the children.
Because a particular Offset can be interpreted as one sense at one time then as the other sense at a later time, the same class is used for both senses.
See also:
 Size, which represents a vector describing the size of a rectangle.
Creates an offset. The first argument sets x, the horizontal component, and the second sets y, the vertical component.
Public methods
copy
fun copy(
x: Float = this.x,
y: Float = this.y
): Offset
Returns a copy of this Offset instance optionally overriding the x or y parameter
div
@Stable operator fun div(operand: Float): Offset
Division operator.
Returns an offset whose coordinates are the coordinates of the lefthandside operand (an Offset) divided by the scalar righthandside operand (a Float).
getDistance
@Stable fun getDistance(): Float
The magnitude of the offset.
If you need this value to compare it to another Offset's distance, consider using getDistanceSquared instead, since it is cheaper to compute.
getDistanceSquared
@Stable fun getDistanceSquared(): Float
The square of the magnitude of the offset.
This is cheaper than computing the getDistance itself.
isValid
@Stable fun isValid(): Boolean
minus
@Stable operator fun minus(other: Offset): Offset
Binary subtraction operator.
Returns an offset whose x value is the lefthandside operand's x minus the righthandside operand's x and whose y value is the lefthandside operand's y minus the righthandside operand's y.
plus
@Stable operator fun plus(other: Offset): Offset
Binary addition operator.
Returns an offset whose x value is the sum of the x values of the two operands, and whose y value is the sum of the y values of the two operands.
rem
@Stable operator fun rem(operand: Float): Offset
Modulo (remainder) operator.
Returns an offset whose coordinates are the remainder of dividing the coordinates of the lefthandside operand (an Offset) by the scalar righthandside operand (a Float).
times
@Stable operator fun times(operand: Float): Offset
Multiplication operator.
Returns an offset whose coordinates are the coordinates of the lefthandside operand (an Offset) multiplied by the scalar righthandside operand (a Float).
toString
fun toString(): String
unaryMinus
@Stable operator fun unaryMinus(): Offset
Unary negation operator.
Returns an offset with the coordinates negated.
If the Offset represents an arrow on a plane, this operator returns the same arrow but pointing in the reverse direction.
Properties
x
@Stable val x: Float
y
@Stable val y: Float
Companion properties
Infinite
@Stable val Infinite: Offset
An offset with infinite x and y components.
See also:
 isInfinite, which checks whether either component is infinite.
 isFinite, which checks whether both components are finite.
Zero
@Stable val Zero: Offset
An offset with zero magnitude.
This can be used to represent the origin of a coordinate space.