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>

ScaledPoint(point: ScaledPoint)

Copy constructor

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

This class represents a point on the ZoomEngine content surface.

Properties

x

var x: Float

y

var y: Float

Functions

minus

operator fun minus(scaledPoint: ScaledPoint): ScaledPoint

Substract a point from another point

plus

operator fun plus(scaledPoint: ScaledPoint): ScaledPoint

Add a point to another point

set

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

Set new coordinates

times

operator fun times(factor: Number): ScaledPoint

Multiply every value in the point by a given factor

unaryMinus

operator fun unaryMinus(): ScaledPoint

Negate a point