Text
Block-level plain-text element. Single style applies to the whole block; rich-text features (inline bold / italic spans, links, cursor-within-text editing) are intentionally NOT in scope here and are tracked separately.
Two-piece geometry — the user owns the wrap width, the renderer owns the measured height. After every layout, if the rendered height drifts from measuredHeight, the renderer dispatches a non-snapshotting io.ak1.drawbox.domain.model.Intent.SyncTextMeasuredHeight to bring the model back in sync — so bounds is always accurate without the data layer needing a androidx.compose.ui.text.TextMeasurer.
Resize semantics follow from this split: dragging a horizontal handle changes wrapWidth (causing a re-wrap and a height update on the next frame); dragging a vertical handle is a no-op since height is auto.
Constructors
Properties
Horizontal alignment inside the wrap box.
Logical name resolved via the host-side io.ak1.drawbox.presentation.viewmodel.DrawBoxController.registerFont registry. Unknown keys fall back to sans.
Renderer-owned cached height. Initialized to a single-line guess at insertion time and refreshed by the sync intent after the first layout pass. Never written by user gestures.
Functions
Scale points so the bounding box matches newBounds. For two-point shapes this snaps start/end to the new bbox corners (preserving orientation of the original drag direction). For freedraw paths every point is scaled linearly. Rotation unchanged.
Absolute rotation in degrees.