ScaleFactor


Holds 2 dimensional scaling factors for horizontal and vertical axes

Summary

Public companion properties

ScaleFactor

A ScaleFactor whose scaleX and scaleY parameters are unspecified.

Cmn

Public functions

inline operator Float
Cmn
inline operator Float
Cmn
ScaleFactor
copy(scaleX: Float, scaleY: Float)

Returns a copy of this ScaleFactor instance optionally overriding the scaleX or scaleY parameters

Cmn
operator ScaleFactor
div(operand: Float)

Division operator.

Cmn
operator ScaleFactor
times(operand: Float)

Multiplication operator.

Cmn
open String
Cmn

Public properties

Float

Returns the scale factor to apply along the horizontal axis

Cmn
Float

Returns the scale factor to apply along the vertical axis

Cmn

Extension functions

inline ScaleFactor

If this ScaleFactor then this is returned, otherwise block is executed and its result is returned.

Cmn
operator Size

Multiplication operator with Size with reverse parameter types to maintain commutative properties of multiplication

Cmn

Extension properties

Boolean

false when this is ScaleFactor.Unspecified.

Cmn
Boolean

true when this is ScaleFactor.Unspecified.

Cmn

Public companion properties

Unspecified

val UnspecifiedScaleFactor

A ScaleFactor whose scaleX and scaleY parameters are unspecified. This is a sentinel value used to initialize a non-null parameter. Access to scaleX or scaleY on an unspecified size is not allowed

Public functions

component1

inline operator fun component1(): Float

component2

inline operator fun component2(): Float

copy

fun copy(scaleX: Float = this.scaleX, scaleY: Float = this.scaleY): ScaleFactor

Returns a copy of this ScaleFactor instance optionally overriding the scaleX or scaleY parameters

div

operator fun div(operand: Float): ScaleFactor

Division operator.

Returns a ScaleFactor with scale x and y values divided by the operand

times

operator fun times(operand: Float): ScaleFactor

Multiplication operator.

Returns a ScaleFactor with scale x and y values multiplied by the operand

toString

open fun toString(): String

Public properties

scaleX

val scaleXFloat

Returns the scale factor to apply along the horizontal axis

scaleY

val scaleYFloat

Returns the scale factor to apply along the vertical axis

Extension functions

takeOrElse

inline fun ScaleFactor.takeOrElse(block: () -> ScaleFactor): ScaleFactor

If this ScaleFactor then this is returned, otherwise block is executed and its result is returned.

times

operator fun ScaleFactor.times(size: Size): Size

Multiplication operator with Size with reverse parameter types to maintain commutative properties of multiplication

Return a new Size with the width and height multiplied by the ScaleFactor.scaleX and ScaleFactor.scaleY respectively

Extension properties

isSpecified

val ScaleFactor.isSpecifiedBoolean

false when this is ScaleFactor.Unspecified.

isUnspecified

val ScaleFactor.isUnspecifiedBoolean

true when this is ScaleFactor.Unspecified.