You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: a layout legend's title longer than its box runs past it #3129
I searched the existing issues and did not find a duplicate.
This is a bug report, not a usage question (questions belong in Discussions).
What happened?
A layout legend draws its title on one line, so a title wider than the legend's box runs past it. A colorbar's title wraps to its box (#2493); a legend's doesn't. Found reading the code (legend_missing in crates/render/src/layout/legend.rs) while reviewing #3127.
Steps to reproduce
Make a layout with a map frame and add a legend about 50 mm wide.
Give it a long title: layout.update {"element": <legend>, "title": "A very long legend title that is much wider than the legend itself"}.
Expected behavior
The title wraps to the box, and the rows start under its last line, as a colorbar's title does.
I'm taking this one: the legend title will wrap within the box the way the colorbar title already does (#2493), with the fit check, sizing and docs following. PR shortly.
Activity
choupeanut commentedon Nov 28, 2026
I'm taking this one: the legend title will wrap within the box the way the colorbar title already does (#2493), with the fit check, sizing and docs following. PR shortly.
layout: leave omitted title lines out of the publication legend's row…
render: legend title fit allows rounding slack at translated boxes (o…
layout: title-wrap tests follow the legend's subtitle (opengeos#3129)
layout: a legend's subtitle is checked against the page under its wra…
layout: the legend tests follow main's legend sizes (opengeos#3129)
layout: a legend added with no title or subtitle says nothing of its …
test: fill LegendAsked.column_breaks in the legend title test (openge…
test: fill column_breaks in the legend title layout tests (opengeos#3129
layout: a publication's legend says the title lines it can't hold, an…
test: fill one_row in the legend title tests (opengeos#3129)