Skip to content

vellum 0.6.1

Choose a tag to compare

@schochastics schochastics released this 31 Jul 11:49
· 21 commits to main since this release

A one-bug patch, and a bug worth explaining.

Node bounding boxes were viewport-local, not device coordinates

lint_table() resolved a node's box through its viewport's scales but never applied the viewport's own placement. element_table() did. So for any viewport not at the page origin the two disagreed by exactly the viewport's offset — which is every real plot with a panel.

Everything built on it inherited the error:

  • vl_repel() mixed viewport-local label boxes with device-space obstacle boxes, so the solver believed the markers were somewhere they were not. On a panelled scatter it left all 22 labels sitting on top of the very markers it had been asked to avoid. Now 0.
  • vl_lint()'s offscreen and low_contrast rules tested and sampled the wrong part of the page.
  • vl_nearest() misplaced text and rounded rects.

scene_model() was never affected — it takes element geometry from element_table(), which was correct — so vellumwidget's contract is untouched.

Why it took this long to find

The bug predates 0.6.0; it has been there since the lint table was introduced. It was invisible to 1691 tests because they all draw into the default full-page viewport, where the transform is the identity and local coordinates are device coordinates.

It surfaced immediately on the first deliberately realistic render — a panel offset from the page origin, with gridlines and labelled markers. That render is now checked in as _docs/critical-plots.R, which exists precisely because this class of bug is invisible to unit tests and obvious to the eye.

The two new tests use an offset panel and assert that both tables agree on a device position, and that repel actually clears the markers there.

All 44 regression artifacts remain byte-identical: this changes reported geometry, not rendering.