lockedTo

fun lockedTo(aspect: AspectRatio, frameAspect: Float, minWidth: Float = DEFAULT_CROP_MIN_WIDTH): CropConstraint(source)

A FixedAspect holding aspect as a picture ratio, on a frame of frameAspect.

FixedAspect.ratio measures the frame on both axes rather than the picture, so a picture ratio is divided by the frame's own aspect on the way in. A square crop on a 16:9 frame is a rectangle nine sixteenths as wide as it is tall in frame fractions, and this is the only place that division happens.

A frameAspect at or below zero has no shape to divide by and answers dev.jordond.filmstrip.compose.ui.CropOverlayDefaults.Constraint.

Return

What the gesture may produce.

Parameters

aspect

The picture ratio the rectangle holds.

frameAspect

Width over height of the frame the rectangle is drawn on, which is the frame the overlay letterboxed the video into.

minWidth

How narrow the rectangle may get, as a fraction of the frame.