diff --git a/.gitignore b/.gitignore index 999382e..cfc8731 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ generated_is.json gui.bin Cargo.lock + +build.sh diff --git a/Cargo.toml b/Cargo.toml index ed63636..16e249a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ description = "Draw graphs with egui." license = "MIT OR Apache-2.0" [dependencies] -egui = "0.23" -eframe = { version = "0.23", default-features = false, features = [ +egui = "0.28" +eframe = { version = "0.28", default-features = false, features = [ "default_fonts", # Embed the default egui fonts. "glow", # Use the glow rendering backend. Alternative: "wgpu". "persistence", # Enable restoring app state when restarting the app. @@ -16,10 +16,10 @@ eframe = { version = "0.23", default-features = false, features = [ # You only need serde if you want app persistence: serde = { version = "1", features = ["derive"] } -layout-rs = "0.1.1" -petgraph = { version = "0.6.3", features = ["serde-1"] } -rand = "0.8.5" -tracing = "0.1.37" +layout-rs = "0.1" +petgraph = { version = "0.6", features = ["serde-1"] } +rand = "0.8" +tracing = "0.1" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/LICENSE-MIT b/LICENSE-MIT index 141b5fa..cefaa0e 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2024 NEVERHACK +Copyright (c) 2024 SILICOM/NEVERHACK Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/examples/hello-world/Cargo.toml b/examples/hello-world/Cargo.toml index 6685687..4bcd0b8 100644 --- a/examples/hello-world/Cargo.toml +++ b/examples/hello-world/Cargo.toml @@ -7,11 +7,11 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -egui = "0.23" -eframe = { version = "0.23", default-features = false, features = [ +egui = "0.28" +eframe = { version = "0.28", default-features = false, features = [ "default_fonts", # Embed the default egui fonts. "glow", # Use the glow rendering backend. Alternative: "wgpu". "persistence", # Enable restoring app state when restarting the app. ] } -petgraph = { version = "0.6.3", features = ["serde-1"] } +petgraph = { version = "0.6", features = ["serde-1"] } egui-gdl = { path = "../.." } diff --git a/examples/hello-world/src/main.rs b/examples/hello-world/src/main.rs index 94c6666..beab905 100644 --- a/examples/hello-world/src/main.rs +++ b/examples/hello-world/src/main.rs @@ -62,7 +62,7 @@ fn main() { options, Box::new(|_| { // This gives us image support: - Box::::default() + Ok(Box::::default()) }), ) .unwrap(); diff --git a/src/lib.rs b/src/lib.rs index 8c34797..9b21a3d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -334,7 +334,7 @@ impl Graph { // Handle zoom if let Some(pos) = ui.ctx().pointer_latest_pos() { - let zoom = ui.input(|i| i.scroll_delta.y); + let zoom = ui.input(|i| i.raw_scroll_delta.y); if zoom != 0. && transform.draw_rect.contains(pos) { transform.user_modified = true; let zoom = (zoom * ZOOM_STEP).exp(); @@ -431,7 +431,7 @@ impl Graph { ); // Here we draw the edge content (can be any widget) - let mut child_ui = ui.child_ui(rect, Layout::top_down(egui::Align::Center)); + let mut child_ui = ui.child_ui(rect, Layout::top_down(egui::Align::Center), None); // Regarding show edge value (which closure parameter to provide), call underlying closure Self::show_transformed(&mut child_ui, transform, &self.inner.config, |ui| { @@ -515,7 +515,7 @@ impl Graph { }; // Here we draw the node content (can be any widget) - let mut child_ui = ui.child_ui(rect, Layout::top_down(egui::Align::Center)); + let mut child_ui = ui.child_ui(rect, Layout::top_down(egui::Align::Center), None); // Regarding show node value (which closure parameter to provide), call underlying closure Self::show_transformed(&mut child_ui, transform, &self.inner.config, |ui| { @@ -631,10 +631,10 @@ impl Graph { ui.style_mut().spacing.icon_spacing *= transform.zoom_factor; ui.style_mut().spacing.tooltip_width *= transform.zoom_factor; ui.style_mut().spacing.combo_height *= transform.zoom_factor; - ui.style_mut().spacing.scroll_bar_width *= transform.zoom_factor; - ui.style_mut().spacing.scroll_handle_min_length *= transform.zoom_factor; - ui.style_mut().spacing.scroll_bar_inner_margin *= transform.zoom_factor; - ui.style_mut().spacing.scroll_bar_outer_margin *= transform.zoom_factor; + ui.style_mut().spacing.scroll.bar_width *= transform.zoom_factor; + ui.style_mut().spacing.scroll.handle_min_length *= transform.zoom_factor; + ui.style_mut().spacing.scroll.bar_inner_margin *= transform.zoom_factor; + ui.style_mut().spacing.scroll.bar_outer_margin *= transform.zoom_factor; // Here we call the closure (show)(ui); diff --git a/src/transform.rs b/src/transform.rs index 8ac7b43..2cf5ed5 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -95,7 +95,7 @@ impl TransformState { self.update(new_position_offset, new_zoom); } - /// Update the screen with position offset and zoom factor + /// Update the screen with position offset and zoom factor. pub fn update(&mut self, position_offset: Vec2, zoom_factor: f32) { self.position_offset = position_offset; self.zoom_factor = zoom_factor;