Google is committed to advancing racial equity for Black communities. See how.

IntOffset

@Immutable inline class IntOffset
kotlin.Any
   ↳ androidx.compose.ui.unit.IntOffset

A two-dimensional position using Int pixels for units

Summary

Public constructors
<init>(packedValue: Long)

A two-dimensional position using Int pixels for units

Public methods
operator Int

operator Int

IntOffset
copy(x: Int = this.x, y: Int = this.y)

Returns a copy of this IntOffset instance optionally overriding the x or y parameter

operator IntOffset
div(operand: Float)

Division operator.

operator IntOffset
minus(other: IntOffset)

Subtract a IntOffset from another one.

operator IntOffset
plus(other: IntOffset)

Add a IntOffset to another one.

operator IntOffset
rem(operand: Int)

Modulo (remainder) operator.

operator IntOffset
times(operand: Float)

Multiplication operator.

String

operator IntOffset

Returns a new IntOffset representing the negation of this point.

Extension functions
From androidx.compose.ui.unit
operator Offset

operator Offset

Offset

Converts the IntOffset to an Offset.

Properties
Int

The horizontal aspect of the position in Int pixels.

Int

The vertical aspect of the position in Int pixels.

Companion properties
IntOffset

IntOffset

Public constructors

<init>

IntOffset(packedValue: Long)

A two-dimensional position using Int pixels for units

Public methods

component1

@Stable operator fun component1(): Int

component2

@Stable operator fun component2(): Int

copy

fun copy(
    x: Int = this.x,
    y: Int = this.y
): IntOffset

Returns a copy of this IntOffset instance optionally overriding the x or y parameter

div

@Stable operator fun div(operand: Float): IntOffset

Division operator.

Returns an IntOffset whose coordinates are the coordinates of the left-hand-side operand (an IntOffset) divided by the scalar right-hand-side operand (a Float). The result is rounded to the nearest integer.

minus

@Stable inline operator fun minus(other: IntOffset): IntOffset

Subtract a IntOffset from another one.

plus

@Stable inline operator fun plus(other: IntOffset): IntOffset

Add a IntOffset to another one.

rem

@Stable operator fun rem(operand: Int): IntOffset

Modulo (remainder) operator.

Returns an IntOffset whose coordinates are the remainder of dividing the coordinates of the left-hand-side operand (an IntOffset) by the scalar right-hand-side operand (an Int).

times

@Stable operator fun times(operand: Float): IntOffset

Multiplication operator.

Returns an IntOffset whose coordinates are the coordinates of the left-hand-side operand (an IntOffset) multiplied by the scalar right-hand-side operand (a Float). The result is rounded to the nearest integer.

toString

@Stable fun toString(): String

unaryMinus

@Stable inline operator fun unaryMinus(): IntOffset

Returns a new IntOffset representing the negation of this point.

Properties

x

@Stable val x: Int

The horizontal aspect of the position in Int pixels.

y

@Stable val y: Int

The vertical aspect of the position in Int pixels.

Companion properties

Origin

val Origin: IntOffset

Deprecated.

Zero

val Zero: IntOffset