Skip to content

Layout: tell a text that runs off the page while it is edited #2703

Done

Description

@jgregoriorincon

What problem does this solve?

A layout text moved or sized so that part of it runs off the page gets no notice while it is edited. Only the export says it ("Text is cut off in …"). A scale bar whose label runs off the page is already told in the app since #2660, and a text that loses lines below its box is told since #2346, but a text past the page's edge isn't.

say_text_fit gets the text's TextLoss, whose off_page flag is set since #2660. It passes that loss to lines_left_out_notice, which speaks only of lines left out, so off_page alone says nothing. A move (x, y) doesn't run the check at all (TEXT_FIT_KEYS leaves moves out).

Proposed solution

  • say_text_fit tells a text whose ink crosses the page's edge, with the advice the export gives: move it inside the page, resize it or reduce its size.
  • A text given x or y is measured, as a scale bar is.
  • One notice a kind, so a text both cut below its box and past the page's edge is told each, as a scale bar is.

Estimated scope

Small: crates/render/src/layout.rs (a notice for off_page) and crates/engine/src/cmd/layout.rs (say_text_fit and the update trigger), with tests: a text moved past each edge is told; one moved back inside, or rotated within the page, isn't.

Alternatives considered

Leaving it to the export: it already reports the cut, but only after the work is done, and the app tells the other text losses as they happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions