pivotPercent

inline fun Style.pivotPercent(@FloatRange(from = 0.0, to = 100.0) pivotXPercent: Float = 50.0f, @FloatRange(from = 0.0, to = 100.0) pivotYPercent: Float = 50.0f): Style

Sets the transform pivot of a View (used for scale and rotation transforms) to be centered at the given percentages of the View's width and height. The default pivot point is (50f, 50f).

The Component this Style is applied to must render to a View which implements SupportsPivotTransform. Rows and Columns both render to ComponentHost which implements this interface. If you need to apply a pivot to a Component that doesn't render to a View that implements this interface, you can either implement this interface in the View it does render to, or wrap this Component in a Row or Column and apply the transform and pivot there instead.

Note: Unlike View.setPivotX and View.setPivotY, the value of this pivot is a percentage, not an absolute pixel value.

Parameters

pivotXPercent

the percentage of the width to use as the pivotX

pivotYPercent

the percentage of the height to use as the pivotY

See also