Skip to content

Multi-line TextShape rotation newly broken in 0.32 #7397

@scvalex

Description

@scvalex

Describe the bug

I am trying to paint multi-line text with rotation:

let (_response, painter) =
    ui.allocate_painter(ui.available_size_before_wrap(), Sense::empty());
let mut layout_job = LayoutJob::default();
let text_color = ui.visuals().text_color();
layout_job.append(
    "A short first line\nA slightly longer second line\nCould this be a third line?",
    0.0,
    TextFormat {
        font_id: FontId::proportional(20.0),
        color: text_color,
        ..Default::default()
    },
);
let galley = painter.layout_job(layout_job);
let text_shape = epaint::TextShape::new(Pos2::new(200.0, 200.0), galley, text_color)
    .with_angle(PI / 2.0);
painter.add(text_shape);

Full repro repo: https://github.com/scvalex/demo-egui-text-rotation-bug

In egui-0.31, this looks like this:

Image

In egui-0.32 and on main, it looks like this:

Image

Desktop (please complete the following information):

  • OS: Linux
  • Browser: n/a (but also happens on Firefox when compiled to wasm)
  • Version: NixOS 25.05 (Warbler)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions