TransformOrigin

@Immutable
class TransformOrigin(val pivotFractionX: Float, val pivotFractionY: Float)

The point scale and rotation are applied around, as fractions of the content's own painted box.

Both fractions are measured from the box's left and top edge whatever the reading order: an origin is a point on the content, and placement has already resolved right-to-left by the time anything paints.

A fraction outside 0f..1f names a point outside the box, which scales the content away from a pivot it does not cover.

Constructors

Link copied to clipboard
constructor(pivotFractionX: Float, pivotFractionY: Float)

Types

Link copied to clipboard
object Companion

The origin scale and rotation are applied around where none is named.

Properties

Link copied to clipboard

where the pivot sits across the width, 0f at the left edge and 1f at the right one.

Link copied to clipboard

where the pivot sits down the height, 0f at the top edge and 1f at the bottom one.

Functions

Link copied to clipboard
@Stable
operator fun component1(): Float

The pivotFractionX component, for destructuring.

Link copied to clipboard
@Stable
operator fun component2(): Float

The pivotFractionY component, for destructuring.

Link copied to clipboard
fun copy(pivotFractionX: Float = this.pivotFractionX, pivotFractionY: Float = this.pivotFractionY): TransformOrigin

A copy of this origin, overriding pivotFractionX and/or pivotFractionY.

Link copied to clipboard
fun createTransform(box: Rectangle2D, scaleX: Float = 1.0f, scaleY: Float = 1.0f, rotationZ: Float = 0.0f): AffineTransform

The Java2D matrix: scale first, then rotate in degrees around this origin in box. Positive rotationZ turns clockwise on screen. The returned transform belongs to the caller.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String