Skip to content

Commit

Permalink
Update to v0.29.1
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Dec 7, 2024
1 parent 95567ed commit 5f07ebf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"

[workspace.dependencies]
egui_nav = { path = "egui-nav" }
egui = "0.28.1"
egui_extras = "0.28.1"
eframe = "0.28.1"
egui_demo_lib = "0.28.1"
egui = "0.29.1"
egui_extras = "0.29.1"
eframe = "0.29.1"
egui_demo_lib = "0.29.1"
18 changes: 8 additions & 10 deletions egui-nav/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl<'a, Route: Clone> Nav<'a, Route> {
// behind transition layer
let transitioning = state.is_transitioning();
if transitioning {
let id = ui.id().with("behind");
let id = ui.id().with("bg");
let min_rect = state.popped_min_rect.unwrap_or(available_rect);
let initial_shift = -min_rect.width() * 0.1;
let mut amt = initial_shift + springy(state.offset);
Expand All @@ -263,15 +263,14 @@ impl<'a, Route: Clone> Nav<'a, Route> {
vec2(state.offset, available_rect.max.y),
);

let layer_id = LayerId::new(Order::Background, id);
let mut ui = egui::Ui::new(
ui.ctx().clone(),
//LayerId::new(Order::Background, id),
LayerId::new(Order::Background, id),
layer_id,
ui.id(),
available_rect,
clip,
egui::UiStackInfo::default(),
egui::UiBuilder::new().max_rect(available_rect)
);
ui.set_clip_rect(clip);

// render the previous nav view in the background when
// transitioning
Expand Down Expand Up @@ -300,7 +299,7 @@ impl<'a, Route: Clone> Nav<'a, Route> {

// foreground layer
{
let id = ui.id().with("front");
let id = ui.id().with("fg");

let layer_id = if transitioning {
// when transitioning, we need a new layer id otherwise the
Expand All @@ -326,10 +325,9 @@ impl<'a, Route: Clone> Nav<'a, Route> {
ui.ctx().clone(),
layer_id,
ui.id(),
available_rect,
clip,
egui::UiStackInfo::default(),
egui::UiBuilder::new().max_rect(available_rect)
);
ui.set_clip_rect(clip);

let response = if let Some(NavAction::Returned) = state.action {
// to avoid a flicker, render the popped route when we
Expand Down

0 comments on commit 5f07ebf

Please sign in to comment.