Skip to content

Commit

Permalink
Update to egui 0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Apr 4, 2024
1 parent 303ecc4 commit 3b2d772
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[workspace]

resolver = "2"

members = [
"egui_node_graph",
"egui_node_graph_example",
]

[egui_node_graph_example.profile.release]
opt-level = 2 # fast and small wasm
2 changes: 1 addition & 1 deletion egui_node_graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workspace = ".."
persistence = ["serde", "slotmap/serde", "smallvec/serde", "egui/persistence"]

[dependencies]
egui = { git = "https://github.com/emilk/egui", rev = "3a8e2348a5d18262a714ccfbcba115176848475c" }
egui = "0.27"
slotmap = { version = "1.0" }
smallvec = { version = "1.10.0" }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down
8 changes: 4 additions & 4 deletions egui_node_graph/src/editor_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ where

// Zoom only within area where graph is shown
if ui.rect_contains_pointer(clip_rect) {
let scroll_delta = ui.input(|i| i.scroll_delta.y);
let scroll_delta = ui.input(|i| i.smooth_scroll_delta.y);
if scroll_delta != 0.0 {
let zoom_delta = (scroll_delta * 0.002).exp();
self.zoom(ui, zoom_delta);
Expand Down Expand Up @@ -187,7 +187,7 @@ where
let cursor_pos = ui
.ctx()
.input(|i| i.pointer.hover_pos().unwrap_or(Pos2::ZERO));
let mut cursor_in_editor = resp.hovered();
let mut cursor_in_editor = resp.contains_pointer();
let mut cursor_in_finder = false;

// Gets filled with the node metrics as they are drawn
Expand Down Expand Up @@ -219,7 +219,7 @@ where
click_on_background = true;
} else if r.drag_started() {
drag_started_on_background = true;
} else if r.drag_released() {
} else if r.drag_stopped() {
drag_released_on_background = true;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ where
/* Draw the node finder, if open */
let mut should_close_node_finder = false;
if let Some(ref mut node_finder) = self.node_finder {
let mut node_finder_area = Area::new("node_finder").order(Order::Foreground);
let mut node_finder_area = Area::new(Id::new("node_finder")).order(Order::Foreground);
if let Some(pos) = node_finder.position {
node_finder_area = node_finder_area.current_pos(pos);
}
Expand Down
7 changes: 2 additions & 5 deletions egui_node_graph/src/scale.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use egui::epaint::Shadow;
use egui::{
style::{Margin, WidgetVisuals},
Rounding, Stroke, Style, Vec2,
};
use egui::{style::WidgetVisuals, Margin, Rounding, Stroke, Style, Vec2};

// Copied from https://github.com/gzp-crey/shine

Expand Down Expand Up @@ -52,7 +49,7 @@ impl Scale for Stroke {

impl Scale for Shadow {
fn scale(&mut self, amount: f32) {
self.extrusion *= amount.clamp(0.4, 1.);
self.spread *= amount.clamp(0.4, 1.);
}
}

Expand Down
4 changes: 1 addition & 3 deletions egui_node_graph_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rust-version = "1.56"
crate-type = ["cdylib", "rlib"]

[dependencies]
eframe = { git = "https://github.com/emilk/egui", rev = "3a8e2348a5d18262a714ccfbcba115176848475c" }
eframe = "0.27"
egui_node_graph = { path = "../egui_node_graph" }
anyhow = "1.0"
serde = { version = "1.0", optional = true }
Expand All @@ -18,5 +18,3 @@ serde = { version = "1.0", optional = true }
default = []
persistence = ["serde", "egui_node_graph/persistence", "eframe/persistence"]

[profile.release]
opt-level = 2 # fast and small wasm

0 comments on commit 3b2d772

Please sign in to comment.