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

87
Cargo.lock generated
View file

@ -972,24 +972,17 @@ dependencies = [
"bytemuck", "bytemuck",
] ]
[[package]]
name = "ecolor"
version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339"
dependencies = [
"bytemuck",
]
[[package]] [[package]]
name = "eframe" name = "eframe"
version = "0.26.2" version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c456c1bb6d13bf68b780257484703d750c70a23ff891ba35f4d6e23a4dbdf26f"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cocoa", "cocoa",
"document-features", "document-features",
"egui 0.26.2 (git+https://github.com/emilk/egui)", "egui",
"egui-wgpu 0.26.2 (git+https://github.com/emilk/egui)", "egui-wgpu",
"egui-winit", "egui-winit",
"egui_glow", "egui_glow",
"glow", "glow",
@ -1020,20 +1013,10 @@ name = "egui"
version = "0.26.2" version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180f595432a5b615fc6b74afef3955249b86cfea72607b40740a4cd60d5297d0" checksum = "180f595432a5b615fc6b74afef3955249b86cfea72607b40740a4cd60d5297d0"
dependencies = [
"ahash",
"epaint 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)",
"nohash-hasher",
]
[[package]]
name = "egui"
version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"ahash", "ahash",
"epaint 0.26.2 (git+https://github.com/emilk/egui)", "epaint",
"log", "log",
"nohash-hasher", "nohash-hasher",
] ]
@ -1043,8 +1026,8 @@ name = "egui-glyphon"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"eframe", "eframe",
"egui 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "egui",
"egui-wgpu 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "egui-wgpu",
"env_logger", "env_logger",
"glyphon", "glyphon",
] ]
@ -1057,24 +1040,8 @@ checksum = "86f2d75e1e70228e7126f828bac05f9fe0e7ea88e9660c8cebe609bb114c61d4"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"document-features", "document-features",
"egui 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "egui",
"epaint 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "epaint",
"log",
"thiserror",
"type-map",
"web-time",
"wgpu",
]
[[package]]
name = "egui-wgpu"
version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339"
dependencies = [
"bytemuck",
"document-features",
"egui 0.26.2 (git+https://github.com/emilk/egui)",
"epaint 0.26.2 (git+https://github.com/emilk/egui)",
"log", "log",
"thiserror", "thiserror",
"type-map", "type-map",
@ -1086,11 +1053,12 @@ dependencies = [
[[package]] [[package]]
name = "egui-winit" name = "egui-winit"
version = "0.26.2" version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4d44f8d89f70d4480545eb2346b76ea88c3022e9f4706cebc799dbe8b004a2"
dependencies = [ dependencies = [
"accesskit_winit", "accesskit_winit",
"arboard", "arboard",
"egui 0.26.2 (git+https://github.com/emilk/egui)", "egui",
"log", "log",
"raw-window-handle 0.6.0", "raw-window-handle 0.6.0",
"smithay-clipboard", "smithay-clipboard",
@ -1102,10 +1070,11 @@ dependencies = [
[[package]] [[package]]
name = "egui_glow" name = "egui_glow"
version = "0.26.2" version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a08e3be8728b4c59493dbfec041c657e6725bdeafdbd49aef3f1dbb9e551fa01"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"egui 0.26.2 (git+https://github.com/emilk/egui)", "egui",
"glow", "glow",
"log", "log",
"memoffset 0.9.0", "memoffset 0.9.0",
@ -1123,14 +1092,6 @@ dependencies = [
"bytemuck", "bytemuck",
] ]
[[package]]
name = "emath"
version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339"
dependencies = [
"bytemuck",
]
[[package]] [[package]]
name = "enumflags2" name = "enumflags2"
version = "0.7.9" version = "0.7.9"
@ -1184,22 +1145,8 @@ dependencies = [
"ab_glyph", "ab_glyph",
"ahash", "ahash",
"bytemuck", "bytemuck",
"ecolor 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "ecolor",
"emath 0.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "emath",
"nohash-hasher",
"parking_lot",
]
[[package]]
name = "epaint"
version = "0.26.2"
source = "git+https://github.com/emilk/egui#a1d5145c16aba4d0b11668d496735d07520d0339"
dependencies = [
"ab_glyph",
"ahash",
"bytemuck",
"ecolor 0.26.2 (git+https://github.com/emilk/egui)",
"emath 0.26.2 (git+https://github.com/emilk/egui)",
"log", "log",
"nohash-hasher", "nohash-hasher",
"parking_lot", "parking_lot",

View file

@ -11,5 +11,5 @@ egui-wgpu = "0.26.2"
glyphon = { git = "https://github.com/StratusFearMe21/glyphon", version = "0.5.0" } glyphon = { git = "https://github.com/StratusFearMe21/glyphon", version = "0.5.0" }
[dev-dependencies] [dev-dependencies]
eframe = { git = "https://github.com/emilk/egui", features = ["wgpu"] } eframe = { version = "0.26.2", features = ["wgpu"] }
env_logger = "0.11.1" env_logger = "0.11.1"

View file

@ -69,7 +69,7 @@ impl Default for MyApp {
buffer.set_size(&mut font_system, 16.0, 9.0); 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.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 { Self {
font_system: Arc::new(Mutex::new(font_system)), font_system: Arc::new(Mutex::new(font_system)),
buffer: Arc::new(RwLock::new(buffer)), buffer: Arc::new(RwLock::new(buffer)),
@ -99,7 +99,7 @@ impl eframe::App for MyApp {
let mut buffer = self.buffer.write(); let mut buffer = self.buffer.write();
buffer.set_metrics(&mut font_system, Metrics::new(self.size, self.size)); buffer.set_metrics(&mut font_system, Metrics::new(self.size, self.size));
buffer.set_size(&mut font_system, size.x, size.y); 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| { egui::CentralPanel::default().show(ctx, |ui| {