inset

Function

Common
inline fun DrawTransform.inset(horizontal: Float = 0.0f, vertical: Float = 0.0f) =
    inset(horizontal, vertical, horizontal, vertical)

Convenience method modifies the DrawTransform bounds to inset both left and right bounds by horizontal as well as the top and bottom by vertical. After this method is invoked, the coordinate space is returned to the state before the inset was applied

Parameters

horizontalnumber of pixels to inset both left and right bounds. Zero by default.
verticalnumber of pixels to inset both top and bottom bounds. Zero by default.
Common
inline fun DrawTransform.inset(inset: Float) = inset(inset, inset)

Convenience method modifies the DrawScope bounds to inset both left, top, right and bottom bounds by inset. After this method is invoked, the coordinate space is returned to the state before this inset was applied.

Parameters

insetnumber of pixels to inset left, top, right, and bottom bounds.
Common
inline fun DrawScope.inset(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    block: DrawScope.() -> Unit,
)

Simultaneously translate the DrawScope coordinate space by left and top as well as modify the dimensions of the current painting area. This provides a callback to issue more drawing instructions within the modified coordinate space. This method modifies the width of the DrawScope to be equivalent to width - (left + right) as well as height to height - (top + bottom). After this method is invoked, the coordinate space is returned to the state before the inset was applied.

Parameters

leftnumber of pixels to inset the left drawing bound
topnumber of pixels to inset the top drawing bound
rightnumber of pixels to inset the right drawing bound
bottomnumber of pixels to inset the bottom drawing bound
blocklambda that is called to issue drawing commands within the inset coordinate space
Common
inline fun DrawScope.inset(inset: Float, block: DrawScope.() -> Unit)

Convenience method modifies the DrawScope bounds to inset both left, top, right and bottom bounds by inset. After this method is invoked, the coordinate space is returned to the state before this inset was applied.

Parameters

insetnumber of pixels to inset left, top, right, and bottom bounds.
blocklambda that is called to issue additional drawing commands within the modified coordinate space
Common
inline fun DrawScope.inset(
    horizontal: Float = 0.0f,
    vertical: Float = 0.0f,
    block: DrawScope.() -> Unit,
) = inset(horizontal, vertical, horizontal, vertical, block)

Convenience method modifies the DrawScope bounds to inset both left and right bounds by horizontal as well as the top and bottom by vertical. After this method is invoked, the coordinate space is returned to the state before this inset was applied.

Parameters

horizontalnumber of pixels to inset both left and right bounds. Zero by default
verticalOptional number of pixels to inset both top and bottom bounds. Zero by default
blocklambda that is called to issue additional drawing commands within the modified coordinate space