Class AffineTransformBuilder

  • AffineTransformBuilder is used to build AffineTransform objects and defaults to the identity transform.

  • Call the build() method to get the AffineTransform object.

  • Methods are available to set scaling, shearing, and translation elements for both X and Y coordinates.

Affine Transform Builder

A builder for Affine Transform objects. Defaults to the identity transform.

Call Affine Transform Builder#build() to get the Affine Transform object.

const transform =
    SlidesApp.newAffineTransformBuilder().setScaleX(2.0).setShearY(1.1).build();

// The resulting transform matrix is
//  [ 2.0   0.0   0.0 ]
//  [ 1.1   1.0   0.0 ]
//  [  0     0     1  ]
}

Methods

Method Return type Brief description
Affine Transform Creates an Affine Transform object initialized with the elements set in the builder.
Affine Transform Builder Sets the X coordinate scaling element and returns the builder.
Affine Transform Builder Sets the Y coordinate scaling element and returns the builder.
Affine Transform Builder Sets the X coordinate shearing element and returns the builder.
Affine Transform Builder Sets the Y coordinate shearing element and returns the builder.
Affine Transform Builder Sets the X coordinate translation element in points, and returns the builder.
Affine Transform Builder Sets the Y coordinate translation element in points, and returns the builder.

Detailed documentation

build()

Creates an Affine Transform object initialized with the elements set in the builder.

Return

Affine Transform — The built Affine Transform object.


set Scale X(scaleX)

Sets the X coordinate scaling element and returns the builder.

Parameters

Name Type Description
scaleX
Number The X scaling.

Return

Affine Transform Builder — This builder, for chaining.


set Scale Y(scaleY)

Sets the Y coordinate scaling element and returns the builder.

Parameters

Name Type Description
scaleY
Number The Y scaling.

Return

Affine Transform Builder — This builder, for chaining.


set Shear X(shearX)

Sets the X coordinate shearing element and returns the builder.

Parameters

Name Type Description
shearX
Number The X shearing.

Return

Affine Transform Builder — This builder, for chaining.


set Shear Y(shearY)

Sets the Y coordinate shearing element and returns the builder.

Parameters

Name Type Description
shearY
Number The Y shearing.

Return

Affine Transform Builder — This builder, for chaining.


set Translate X(translateX)

Sets the X coordinate translation element in points, and returns the builder.

Parameters

Name Type Description
translateX
Number The X translation in points.

Return

Affine Transform Builder — This builder, for chaining.


set Translate Y(translateY)

Sets the Y coordinate translation element in points, and returns the builder.

Parameters

Name Type Description
translateY
Number The Y translation in points.

Return

Affine Transform Builder — This builder, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: