Skip to content

Commit

Permalink
chore: fix build errors with egui 0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
theoparis committed Jul 12, 2024
1 parent f1802ff commit df649a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
12 changes: 2 additions & 10 deletions examples/simple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use eframe::{self, egui};
use egui_nodes::{Context, LinkArgs, NodeArgs, NodeConstructor, PinArgs, PinShape};

#[derive(Default)]
struct MyApp {
ctx: Context,
links: Vec<(usize, usize)>,
Expand Down Expand Up @@ -60,15 +61,6 @@ pub fn example_graph(ctx: &mut Context, links: &mut Vec<(usize, usize)>, ui: &mu
}
}

impl Default for MyApp {
fn default() -> Self {
Self {
ctx: Context::default(),
links: Vec::new(),
}
}
}

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
Expand All @@ -82,7 +74,7 @@ fn main() {
eframe::run_native(
"My egui app",
eframe::NativeOptions::default(),
Box::new(|_cc| Box::<MyApp>::default()),
Box::new(|_cc| Ok(Box::<MyApp>::default())),
)
.unwrap();
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ impl Context {
let mut ui = ui.child_ui(
self.canvas_rect_screen_space,
egui::Layout::top_down(egui::Align::Center),
None,
);
{
let ui = &mut ui;
Expand Down
2 changes: 1 addition & 1 deletion src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl LinkBezierData {
points,
closed: false,
fill: egui::Color32::TRANSPARENT,
stroke: stroke.into(),
stroke: stroke.into().into(),
};
egui::Shape::Path(path_shape)
}
Expand Down

0 comments on commit df649a7

Please sign in to comment.