Fix example

This commit is contained in:
Isaac Mills 2024-03-06 18:04:23 -05:00
parent 4da780b8f2
commit 469adc63a4
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
3 changed files with 20 additions and 73 deletions

View file

@ -69,7 +69,7 @@ impl Default for MyApp {
buffer.set_size(&mut font_system, 16.0, 9.0);
buffer.set_text(&mut font_system, "<== Hello world! ==> 👋\nThis is rendered with 🦅 glyphon 🦁\nThe text below should be partially clipped.\na b c d e f g h i j k l m n o p q r s t u v w x y z", Attrs::new().family(Family::SansSerif), Shaping::Advanced);
buffer.shape_until_scroll(&mut font_system);
buffer.shape_until_scroll(&mut font_system, true);
Self {
font_system: Arc::new(Mutex::new(font_system)),
buffer: Arc::new(RwLock::new(buffer)),
@ -99,7 +99,7 @@ impl eframe::App for MyApp {
let mut buffer = self.buffer.write();
buffer.set_metrics(&mut font_system, Metrics::new(self.size, self.size));
buffer.set_size(&mut font_system, size.x, size.y);
buffer.shape_until_scroll(&mut font_system);
buffer.shape_until_scroll(&mut font_system, true);
}
egui::CentralPanel::default().show(ctx, |ui| {