Skip to content

vellum 0.6.4

Choose a tag to compare

@schochastics schochastics released this 31 Jul 18:53
· 18 commits to main since this release

One bug, and the same shape as 0.6.3: a capability that worked when drawn and not when measured.

grobwidth()/grobheight() ignored a text grob's wrapping width

The renderer wraps a text_grob(width = ) to its box and auto-fits when fit = is set. The measurement path — what a grobwidth/grobheight unit resolves to — measured the unwrapped line.

So a layout track sized by grobheight() reserved a single line for a label that drew as several, and the wrapped text overran whatever sat above it. Exactly the failure you would hit sizing a title block or a caption gutter.

Extent now wraps the label to width, stacks the resulting lines, and applies the same auto-fit shrink as drawing, so a reserved region matches the glyphs that land in it. It mirrors the draw path rather than reimplementing the layout, which is what keeps the two from drifting apart again.

Plain labels only. Rich md() labels are unchanged, because the renderer does not width-wrap them either — measuring a wrap that never happens would be the same bug pointing the other way.

Rendering is unaffected; all 44 regression artifacts are byte-identical. This changes measurement.

Note

Like 0.6.3, this was found by using the engine from vellumplot — here while wiring wrapped plot titles, subtitles and captions — rather than by testing it in isolation. Two releases in a row from the same source, which is a reasonable argument for the downstream integration pass continuing to run ahead of new engine work.