File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ impl ContextImpl {
567567 }
568568
569569 /// Load fonts unless already loaded.
570- fn update_fonts_mut ( & mut self ) {
570+ pub ( crate ) fn update_fonts_mut ( & mut self ) {
571571 crate :: profile_function!( ) ;
572572
573573 let input = & self . viewport ( ) . input ;
@@ -1762,22 +1762,8 @@ impl Context {
17621762 pub fn set_fonts ( & self , font_definitions : FontDefinitions ) {
17631763 crate :: profile_function!( ) ;
17641764
1765- let pixels_per_point = self . pixels_per_point ( ) ;
1766-
1767- let mut update_fonts = true ;
1768-
1769- self . read ( |ctx| {
1770- if let Some ( current_fonts) = ctx. fonts . get ( & pixels_per_point. into ( ) ) {
1771- // NOTE: this comparison is expensive since it checks TTF data for equality
1772- if current_fonts. lock ( ) . fonts . definitions ( ) == & font_definitions {
1773- update_fonts = false ; // no need to update
1774- }
1775- }
1776- } ) ;
1777-
1778- if update_fonts {
1779- self . memory_mut ( |mem| mem. new_font_definitions = Some ( font_definitions) ) ;
1780- }
1765+ self . memory_mut ( |mem| mem. new_font_definitions = Some ( font_definitions) ) ;
1766+ self . write ( |ctx| ctx. update_fonts_mut ( ) ) ;
17811767 }
17821768
17831769 /// Tell `egui` which fonts to use.
You can’t perform that action at this time.
0 commit comments