Skip to content

[Bug]: a layout legend's title longer than its box runs past it #3129

Backlog

Description

@jgregoriorincon

Before you start

  • 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

  1. Make a layout with a map frame and add a legend about 50 mm wide.
  2. 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.

How are you running RustGIS?

All builds: the drawing is shared.

Version

main (0.8.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed possible issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions