{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

TransformOrigin

value public final class TransformOrigin


A two-dimensional position represented as a fraction of the Layer's width and height

Summary

Nested types

public static class TransformOrigin.Companion

Public methods

final float
final float
final @NonNull TransformOrigin
copy(float pivotFractionX, float pivotFractionY)

Returns a copy of this TransformOrigin instance optionally overriding the pivotFractionX or pivotFractionY parameter

final float

Return the position along the x-axis that should be used as the origin for rotation and scale transformations.

final float

Return the position along the y-axis that should be used as the origin for rotation and scale transformations.

Public methods

component1

public final float component1()

component2

public final float component2()

copy

public final @NonNull TransformOrigin copy(float pivotFractionX, float pivotFractionY)

Returns a copy of this TransformOrigin instance optionally overriding the pivotFractionX or pivotFractionY parameter

getPivotFractionX

public final float getPivotFractionX()

Return the position along the x-axis that should be used as the origin for rotation and scale transformations. This is represented as a fraction of the width of the content. A value of 0.5f represents the midpoint between the left and right bounds of the content

getPivotFractionY

public final float getPivotFractionY()

Return the position along the y-axis that should be used as the origin for rotation and scale transformations. This is represented as a fraction of the height of the content. A value of 0.5f represents the midpoint between the top and bottom bounds of the content