egui icon indicating copy to clipboard operation
egui copied to clipboard

Label with LayoutJob halign LEFT is still centering the text

Open cbeust opened this issue 3 years ago • 1 comments

Describe the bug

Creating a LayoutJob as follows is still causing the text to be centered in the Label:

let mut layout_job = LayoutJob::simple("Simple layout".to_string(), FontId::default(), Color32::GREEN, 100.0);
layout_job.halign = Align::LEFT;
ui.add(vec2(500.0, 15.0), Label::new(layout_job);

Expected behavior

The text should be aligned left.

cbeust avatar Jul 10 '22 19:07 cbeust

Interesting - looking at the code in Label::layout_in_ui it should take halign into account. Perhaps add a breakpoint there and see what you can figure out?

emilk avatar Jul 21 '22 18:07 emilk