library / com.otaliastudios.zoom / ScaledPoint

ScaledPoint

data class ScaledPoint

This class represents a point on the ZoomEngine content surface.

It is scaled because, unlike AbsolutePoint, it is affected by the current zoom level. If content is zoomed in, the exact same content point will have bigger ScaledPoint coordinates.

Constructors

<init>

Copy constructor

ScaledPoint(point: ScaledPoint)

This class represents a point on the ZoomEngine content surface.

ScaledPoint(x: Float = 0F, y: Float = 0F)

Properties

x

var x: Float

y

var y: Float

Functions

minus

Substract a point from another point

operator fun minus(scaledPoint: ScaledPoint): ScaledPoint

plus

Add a point to another point

operator fun plus(scaledPoint: ScaledPoint): ScaledPoint

set

Set new coordinates

fun set(x: Number = this.x, y: Number = this.y): Unit
fun set(p: ScaledPoint): Unit

times

Multiply every value in the point by a given factor

operator fun times(factor: Number): ScaledPoint

unaryMinus

Negate a point

operator fun unaryMinus(): ScaledPoint