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:
parent
7c5a2d60c5
commit
a9c004d16b
2 changed files with 9 additions and 1 deletions
|
@ -13,6 +13,9 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [
|
||||||
* [Progress bar](https://github.com/emilk/egui/pull/519)
|
* [Progress bar](https://github.com/emilk/egui/pull/519)
|
||||||
* `Grid::num_columns`: allow the last column to take up the rest of the space of the parent `Ui`.
|
* `Grid::num_columns`: allow the last column to take up the rest of the space of the parent `Ui`.
|
||||||
|
|
||||||
|
### Fixed 🐛
|
||||||
|
* Fix custom font definitions getting replaced when `pixels_per_point` is changed.
|
||||||
|
|
||||||
|
|
||||||
## 0.13.1 - 2021-06-28 - Plot fixes
|
## 0.13.1 - 2021-06-28 - Plot fixes
|
||||||
|
|
||||||
|
|
|
@ -578,7 +578,12 @@ impl Context {
|
||||||
if self.fonts.is_none() || new_font_definitions.is_some() || pixels_per_point_changed {
|
if self.fonts.is_none() || new_font_definitions.is_some() || pixels_per_point_changed {
|
||||||
self.fonts = Some(Arc::new(Fonts::from_definitions(
|
self.fonts = Some(Arc::new(Fonts::from_definitions(
|
||||||
pixels_per_point,
|
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()
|
||||||
|
}),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue