# RectangularTransform

class RectangularTransform

This is a transform that only scales and translates. It is a subset of an `AffineTransform`, except with no rotation/shearing.

## Constructors

RectangularTransform
Link copied to clipboard
constructor()

Creates an identity transform.

constructor(oldRect: Rectangle2D, newRect: Rectangle2D)

Creates a `RectangularTransform` that transforms from one rectangle to another.

constructor(sx: Double, sy: Double, tx: Double, ty: Double)

Creates a `RectangularTransform`.

## Types

Companion
Link copied to clipboard
object Companion

## Properties

scaleX
Link copied to clipboard
var scaleX: Double
scaleY
Link copied to clipboard
var scaleY: Double
translateX
Link copied to clipboard
var translateX: Double
translateY
Link copied to clipboard
var translateY: Double

## Functions

createAffineTransform
Link copied to clipboard
fun createAffineTransform(): AffineTransform

Converts this to an `AffineTransform`.

createInverse
Link copied to clipboard
fun createInverse(): RectangularTransform

Creates a transform that is the inverse of this one.

scale
Link copied to clipboard
fun scale(sx: Double, sy: Double)

Scales this transform.

setTransform
Link copied to clipboard
fun setTransform(oldRect: Rectangle2D, newRect: Rectangle2D)

Defines this transform.

transform
Link copied to clipboard
fun transform(src: Point2D): Point2D
fun transform(src: Rectangle2D): Rectangle2D

Transforms the source argument.

translate
Link copied to clipboard
fun translate(tx: Double, ty: Double)

Translates this transform.