mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 15:20:05 -04:00
Fix WidgetText::Text ignoring fallback font and overrides (#7361)
* closes https://github.com/emilk/egui/issues/7356
This commit is contained in:
committed by
Emil Ernerfeldt
parent
4fcd1d13e3
commit
97fe124443
@@ -1,4 +1,4 @@
|
||||
use crate::{Id, Image, ImageSource, SizedAtomKind, TextStyle, Ui, WidgetText};
|
||||
use crate::{FontSelection, Id, Image, ImageSource, SizedAtomKind, Ui, WidgetText};
|
||||
use emath::Vec2;
|
||||
use epaint::text::TextWrapMode;
|
||||
|
||||
@@ -78,12 +78,12 @@ impl<'a> AtomKind<'a> {
|
||||
ui: &Ui,
|
||||
available_size: Vec2,
|
||||
wrap_mode: Option<TextWrapMode>,
|
||||
fallback_font: FontSelection,
|
||||
) -> (Vec2, SizedAtomKind<'a>) {
|
||||
match self {
|
||||
AtomKind::Text(text) => {
|
||||
let wrap_mode = wrap_mode.unwrap_or(ui.wrap_mode());
|
||||
let galley =
|
||||
text.into_galley(ui, Some(wrap_mode), available_size.x, TextStyle::Button);
|
||||
let galley = text.into_galley(ui, Some(wrap_mode), available_size.x, fallback_font);
|
||||
(galley.intrinsic_size(), SizedAtomKind::Text(galley))
|
||||
}
|
||||
AtomKind::Image(image) => {
|
||||
|
||||
Reference in New Issue
Block a user