mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Add Align2::anchor_size (#3863)
This commit is contained in:
@@ -229,7 +229,7 @@ impl Painter {
|
||||
text: impl ToString,
|
||||
) -> Rect {
|
||||
let galley = self.layout_no_wrap(text.to_string(), FontId::monospace(12.0), color);
|
||||
let rect = anchor.anchor_rect(Rect::from_min_size(pos, galley.size()));
|
||||
let rect = anchor.anchor_size(pos, galley.size());
|
||||
let frame_rect = rect.expand(2.0);
|
||||
self.add(Shape::rect_filled(
|
||||
frame_rect,
|
||||
@@ -378,7 +378,7 @@ impl Painter {
|
||||
text_color: Color32,
|
||||
) -> Rect {
|
||||
let galley = self.layout_no_wrap(text.to_string(), font_id, text_color);
|
||||
let rect = anchor.anchor_rect(Rect::from_min_size(pos, galley.size()));
|
||||
let rect = anchor.anchor_size(pos, galley.size());
|
||||
self.galley(rect.min, galley, text_color);
|
||||
rect
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user