CacheDrawScope


Handle to a drawing environment that enables caching of content based on the resolved size. Consumers define parameters and refer to them in the captured draw callback provided in onDrawBehind or onDrawWithContent.

onDrawBehind will draw behind the layout's drawing contents however, onDrawWithContent will provide the ability to draw before or after the layout's contents

Summary

Public functions

DrawResult
onDrawBehind(block: DrawScope.() -> Unit)

Issue drawing commands to be executed before the layout content is drawn

Cmn
DrawResult

Issue drawing commands before or after the layout's drawing contents

Cmn

Public properties

open Float

The logical density of the display.

Cmn
open Float

Current user preference for the scaling factor for fonts.

Cmn
LayoutDirection

Provides the LayoutDirection.

Cmn
Size

Provides the dimensions of the current drawing environment

Cmn

Inherited functions

From androidx.compose.ui.unit.Density
open Int

Convert Dp to Int by rounding

Cmn
open Int

Convert Sp to Int by rounding

Cmn
open Dp

Convert an Int pixel value to Dp.

Cmn
open Dp

Convert a Float pixel value to a Dp

Cmn
open DpSize

Convert a Size to a DpSize.

Cmn
open Float

Convert Dp to pixels.

Cmn
open Float

Convert Sp to pixels.

Cmn
open Rect

Convert a DpRect to a Rect.

Cmn
open Size

Convert a DpSize to a Size.

Cmn
open TextUnit

Convert an Int pixel value to Sp.

Cmn
open TextUnit

Convert a Float pixel value to a Sp

Cmn
From androidx.compose.ui.unit.FontScaling
open Dp

Convert Sp to Dp.

Cmn
open TextUnit

Convert Dp to Sp.

Cmn

Public functions

onDrawBehind

fun onDrawBehind(block: DrawScope.() -> Unit): DrawResult

Issue drawing commands to be executed before the layout content is drawn

onDrawWithContent

fun onDrawWithContent(block: ContentDrawScope.() -> Unit): DrawResult

Issue drawing commands before or after the layout's drawing contents

Public properties

density

open val densityFloat

The logical density of the display. This is a scaling factor for the Dp unit.

fontScale

open val fontScaleFloat

Current user preference for the scaling factor for fonts.

layoutDirection

val layoutDirectionLayoutDirection

Provides the LayoutDirection.

size

val sizeSize

Provides the dimensions of the current drawing environment