mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Fix custom font definitions getting replaced when pixels_per_point is changed (#564)
- This bug is most noticable when default fonts are disabled.
This commit is contained in:
@@ -578,7 +578,12 @@ impl Context {
|
||||
if self.fonts.is_none() || new_font_definitions.is_some() || pixels_per_point_changed {
|
||||
self.fonts = Some(Arc::new(Fonts::from_definitions(
|
||||
pixels_per_point,
|
||||
new_font_definitions.unwrap_or_default(),
|
||||
new_font_definitions.unwrap_or_else(|| {
|
||||
self.fonts
|
||||
.as_ref()
|
||||
.map(|font| font.definitions().clone())
|
||||
.unwrap_or_default()
|
||||
}),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user