TransformOrigin
@Immutable inline class TransformOrigin
kotlin.Any | |
↳ | androidx.compose.ui.graphics.TransformOrigin |
A two-dimensional position represented as a fraction of the Layer's width and height
Summary
Public constructors | |
---|---|
A two-dimensional position represented as a fraction of the Layer's width and height |
Public methods | |
---|---|
operator Float | |
operator Float | |
TransformOrigin |
Returns a copy of this TransformOrigin instance optionally overriding the pivotFractionX or pivotFractionY parameter |
Properties | |
---|---|
Float |
Return the position along the x-axis that should be used as the origin for rotation and scale transformations. |
Float |
Return the position along the y-axis that should be used as the origin for rotation and scale transformations. |
Companion properties | |
---|---|
TransformOrigin |
TransformOrigin constant to indicate that the center of the content should be used for rotation and scale transformations |
Public constructors
<init>
TransformOrigin(packedValue: Long)
A two-dimensional position represented as a fraction of the Layer's width and height
Public methods
component1
@Stable inline operator fun component1(): Float
component2
@Stable inline operator fun component2(): Float
copy
fun copy(
pivotFractionX: Float = this.pivotFractionX,
pivotFractionY: Float = this.pivotFractionY
): TransformOrigin
Returns a copy of this TransformOrigin instance optionally overriding the pivotFractionX or pivotFractionY parameter
Properties
pivotFractionX
val pivotFractionX: Float
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
pivotFractionY
val pivotFractionY: Float
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
Companion properties
Center
val Center: TransformOrigin
TransformOrigin constant to indicate that the center of the content should be used for rotation and scale transformations