Trim the drag copy's layout note (#267)

This commit is contained in:
2026-09-04 17:27:09 +02:00
parent 8db99868af
commit c2fbfb0bef

View File

@@ -724,12 +724,9 @@ private fun DragCopy(
val timeLineHeight = with(density) { val timeLineHeight = with(density) {
MaterialTheme.typography.labelSmall.lineHeight.toDp() MaterialTheme.typography.labelSmall.lineHeight.toDp()
} }
// The copy is the block's size and spends its height the same way, so text // The block's size, spent the block's way, so nothing reflows under the
// wraps here exactly where it wrapped there rather than reflowing under the // finger (#267) — but the range is paid for first, since it may be showing
// finger and snapping back on drop (#267). The range is paid for first — // where a block too short for it will land, and nothing clips the overrun.
// where the drop lands is what the drag is for, and the block may have been
// too short to show it — and the title takes what of its lines still fit,
// since nothing clips a copy that outgrows its block.
val available = height - BLOCK_TEXT_INSET * 2 val available = height - BLOCK_TEXT_INSET * 2
val reserved = if (label == null) 0.dp else timeLineHeight val reserved = if (label == null) 0.dp else timeLineHeight
val titleBudget = ((available - reserved) / titleLineHeight).toInt().coerceAtLeast(0) val titleBudget = ((available - reserved) / titleLineHeight).toInt().coerceAtLeast(0)