Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Update to egui 0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Nov 26, 2023
1 parent 9163f8d commit 16a81bc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
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 = { version = "0.22" }
egui = { version = "0.24" }
slotmap = { version = "1.0" }
smallvec = { version = "1.10.0" }
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down
10 changes: 9 additions & 1 deletion egui_node_graph/src/editor_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ where
.titlebar_color(ui, self.node_id, self.graph, user_state)
.unwrap_or_else(|| background_color.lighten(0.8)),
stroke: Stroke::NONE,
fill_texture_id: Default::default(),
uv: Rect::ZERO,
});

let body_rect = Rect::from_min_size(
Expand All @@ -919,9 +921,11 @@ where
);
let body = Shape::Rect(RectShape {
rect: body_rect,
rounding: Rounding::none(),
rounding: Rounding::ZERO,
fill: background_color,
stroke: Stroke::NONE,
fill_texture_id: Default::default(),
uv: Rect::ZERO,
});

let bottom_body_rect = Rect::from_min_size(
Expand All @@ -933,6 +937,8 @@ where
rounding,
fill: background_color,
stroke: Stroke::NONE,
fill_texture_id: Default::default(),
uv: Rect::ZERO,
});

let node_rect = titlebar_rect.union(body_rect).union(bottom_body_rect);
Expand All @@ -942,6 +948,8 @@ where
rounding,
fill: Color32::WHITE.lighten(0.8),
stroke: Stroke::NONE,
fill_texture_id: Default::default(),
uv: Rect::ZERO,
})
} else {
Shape::Noop
Expand Down
6 changes: 4 additions & 2 deletions egui_node_graph/src/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ impl Scale for Style {
self.spacing.icon_spacing *= amount;
self.spacing.tooltip_width *= amount;
self.spacing.combo_height *= amount;
self.spacing.scroll_bar_width *= amount;
self.spacing.scroll.bar_width *= amount;
self.spacing.scroll.floating_allocated_width *= amount;
self.spacing.scroll.floating_width *= amount;

self.interaction.resize_grab_radius_side *= amount;
self.interaction.resize_grab_radius_corner *= amount;
Expand All @@ -101,7 +103,7 @@ impl Scale for Style {
self.visuals.selection.stroke.scale(amount);

self.visuals.resize_corner_size *= amount;
self.visuals.text_cursor_width *= amount;
self.visuals.text_cursor.width *= amount;
self.visuals.clip_rect_margin *= amount;
self.visuals.window_rounding.scale(amount);
self.visuals.window_shadow.scale(amount);
Expand Down
2 changes: 1 addition & 1 deletion 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 = "0.22"
eframe = "0.24"
egui_node_graph = { path = "../egui_node_graph" }
anyhow = "1.0"
serde = { version = "1.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion egui_node_graph_example/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct MyGraphState {

// A trait for the data types, to tell the library how to display them
impl DataTypeTrait<MyGraphState> for MyDataType {
fn data_type_color(&self, _user_state: &mut MyGraphState) -> egui::Color32 {
fn data_type_color(&self, _user_state: &mut MyGraphState) -> egui::ecolor::Color32 {
match self {
MyDataType::Scalar => egui::Color32::from_rgb(38, 109, 211),
MyDataType::Vec2 => egui::Color32::from_rgb(238, 207, 109),
Expand Down

0 comments on commit 16a81bc

Please sign in to comment.