IntSize


A two-dimensional size class used for measuring in Int pixels.

To create an IntSize, call the top-level function that accepts a width/height pair of dimensions:

val size = IntSize(width, height)

The primary constructor of IntSize is intended to be used with the packedValue property to allow storing sizes in arrays or collections of primitives without boxing.

Summary

Nested types

Public companion properties

IntSize

IntSize with a zero (0) width and height.

Cmn

Public functions

inline operator Int
Cmn
inline operator Int
Cmn
operator IntSize
div(other: Int)

Returns an IntSize scaled by dividing width and height by other

Cmn
operator IntSize
times(other: Int)

Returns an IntSize scaled by multiplying width and height by other

Cmn
open String
Cmn

Public properties

Int

The vertical aspect of the size in Int pixels.

Cmn
Long

Long value encoding the width and height components of the IntSize.

Cmn
Int

The horizontal aspect of the size in Int pixels.

Cmn

Extension functions

IntRect

Convert a IntSize to a IntRect.

Cmn
Size
Cmn

Extension properties

IntOffset

Returns the IntOffset of the center of the rect from the point of 0, 0 with this IntSize.

Cmn

Public companion properties

Zero

val ZeroIntSize

IntSize with a zero (0) width and height.

Public functions

component1

inline operator fun component1(): Int

component2

inline operator fun component2(): Int

div

operator fun div(other: Int): IntSize

Returns an IntSize scaled by dividing width and height by other

times

operator fun times(other: Int): IntSize

Returns an IntSize scaled by multiplying width and height by other

toString

open fun toString(): String

Public properties

height

val heightInt

The vertical aspect of the size in Int pixels.

packedValue

val packedValueLong

Long value encoding the width and height components of the IntSize. Encoded values can be obtained by using the packedValue property of existing IntSize instances.

width

val widthInt

The horizontal aspect of the size in Int pixels.

Extension functions

toIntRect

fun IntSize.toIntRect(): IntRect

Convert a IntSize to a IntRect.

Extension properties

val IntSize.centerIntOffset

Returns the IntOffset of the center of the rect from the point of 0, 0 with this IntSize.