Skip to content

Commit

Permalink
Extracted drawer (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzarx1 authored May 2, 2023
1 parent 5281610 commit e0b51e0
Show file tree
Hide file tree
Showing 12 changed files with 455 additions and 413 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "egui_graphs"
version = "0.4.0"
version = "0.4.1"
authors = ["Dmitrii Samsonov <[email protected]>"]
license = "MIT"
homepage = "https://github.com/blitzarx1/egui_graphs"
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "basic"
version = "0.4.0"
version = "0.4.1"
authors = ["Dmitrii Samsonov <[email protected]>"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion examples/configurable/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "configurable"
version = "0.4.0"
version = "0.4.1"
authors = ["Dmitrii Samsonov <[email protected]>"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion examples/interactive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "interactive"
version = "0.4.0"
version = "0.4.1"
authors = ["Dmitrii Samsonov <[email protected]>"]
license = "MIT"
edition = "2021"
Expand Down
16 changes: 12 additions & 4 deletions src/change.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui::Vec2;
use petgraph::stable_graph::{NodeIndex, EdgeIndex};
use petgraph::stable_graph::{EdgeIndex, NodeIndex};

/// `ChangeNode` is a enum that stores the changes to `Node` properties.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -67,12 +67,20 @@ mod tests {
let old_node_location = vec2(0.0, 0.0);
let new_node_location = vec2(10.0, 10.0);

let node_change = Change::node(ChangeNode::change_location(node_id, old_node_location, new_node_location));
let node_change = Change::node(ChangeNode::change_location(
node_id,
old_node_location,
new_node_location,
));

let node_selected_old = false;
let node_selected_new = true;

let edge_change = Change::edge(ChangeEdge::change_selected(edge_id, node_selected_old, node_selected_new));
let edge_change = Change::edge(ChangeEdge::change_selected(
edge_id,
node_selected_old,
node_selected_new,
));

match node_change {
Change::Node(ChangeNode::Location { id, old, new }) => {
Expand All @@ -92,4 +100,4 @@ mod tests {
_ => panic!("Unexpected edge change type"),
}
}
}
}
Loading

0 comments on commit e0b51e0

Please sign in to comment.