drawBackground

open fun DrawScope.drawBackground(layoutResult: TextLayoutResult, lineWrap: LineWrap, textRange: TextRange, state: TextEditorState)(source)

Paints behind the text — runs BEFORE drawText for the line, so opaque fills don't obscure the text on top. Default no-op; styles that want a transparent decoration over the text should keep using drawCustomStyle.

Use this for solid card fills (code blocks, callouts) where readability inside the card matters more than seeing the body color through the fill.