mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Add justified and/or center- and right-aligned text
Label text will now be centered, right-aligned and/or justified based on the layout. Galleys are no longer always pivoted in the left top corner, so now have a Rect rather than just a size.
This commit is contained in:
@@ -361,7 +361,7 @@ impl ColoredText {
|
||||
let mut job = self.0.clone();
|
||||
job.wrap_width = ui.available_width();
|
||||
let galley = ui.fonts().layout_job(job);
|
||||
let (response, painter) = ui.allocate_painter(galley.size, egui::Sense::hover());
|
||||
let (response, painter) = ui.allocate_painter(galley.size(), egui::Sense::hover());
|
||||
painter.add(egui::Shape::galley(response.rect.min, galley));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user