MeasuringContext

Holds data used for measuring and drawing.

Inheritors

Properties

Link copied to clipboard
abstract val cacheStore: CacheStore

Caches drawing data.

Link copied to clipboard
abstract val canvasBounds: RectF

The bounds of the Canvas.

Link copied to clipboard
abstract val density: Float

The number of pixels corresponding to one density-independent pixel.

Link copied to clipboard
abstract val isLtr: Boolean

Whether the layout direction is left to right.

Link copied to clipboard

1f if isLtr is true, and -1f otherwise.

Link copied to clipboard
open val Float.pixels: Float

The number of pixels corresponding to this number of density-independent pixels.

Link copied to clipboard

The number of pixels corresponding to this number of density-independent pixels, rounded down to an integer.

Functions

Link copied to clipboard
open fun dpToPx(dp: Float): Float

Returns the number of pixels corresponding to dp density-independent pixels.

Link copied to clipboard
open fun reset()

Removes all temporary data.

Link copied to clipboard
abstract fun spToPx(sp: Float): Float

Returns the number of pixels corresponding to sp scalable pixels.