Function
Common
fun TrackpadInjectionScope.scale(
    @FloatRange(from = 0.0, fromInclusive = false) scaleFactor: Float
)

Sends a scale event with the given scaleFactor. The event will be sent starting at the current event time.

The scaleFactor is a multiplicative zoom factor. A scaleFactor of 1 represents no change. A scaleFactor less than 1 represents a "zoom out" gesture, while a factor of more than one represents a "zoom in" gesture.

Parameters

scaleFactor The amount to scale.

Code Examples

trackpadInputScale

fun trackpadInputScale() {
    composeTestRule.onNodeWithTag("transformable").performTrackpadInput {
        // Performs a scale with a factor of 0.9f, which corresponds to a "zoom out" gesture.
        scale(0.9f)
    }
}