Skip to content

Commit

Permalink
Fix egui_taffy
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Jan 4, 2024
1 parent 29f5a14 commit 3e3868b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion crates/egui_dnd/examples/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use egui_dnd::{dnd, DragDropItem, Handle};

pub fn main() {
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
..Default::default()
};
eframe::run_native("DnD", options, Box::new(|_cc| Box::<MyApp>::default())).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions crates/egui_taffy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use taffy::prelude::*;
type Node = NodeId;

struct TaffyState {
taffy: Taffy<(usize, egui::Layout)>,
taffy: TaffyTree<(usize, egui::Layout)>,

children: Vec<EguiTaffyNode>,

Expand All @@ -28,7 +28,7 @@ unsafe impl Sync for TaffyState {}

impl TaffyState {
pub fn new() -> Self {
let mut taffy = Taffy::new();
let mut taffy = TaffyTree::new();

Self {
root_node: taffy.new_with_children(Style::default(), &[]).unwrap(),
Expand Down Expand Up @@ -271,7 +271,7 @@ impl<'a, 'f> TaffyPass<'a, 'f> {
let result_rect = response.response.rect;

Size {
width: result_rect.width().ceil(),
width: result_rect.width().ceil() + 0.01,
height: result_rect.height(),
}
},
Expand Down
3 changes: 1 addition & 2 deletions fancy-example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::hash::Hash;
use std::time::Duration;

use eframe::egui::Color32;
use eframe::emath::lerp;
Expand Down Expand Up @@ -138,7 +137,7 @@ fn main() -> eframe::Result<()> {
std::thread::spawn(move || {
rt.block_on(async {
loop {
tokio::time::sleep(Duration::from_secs(3600)).await;
tokio::time::sleep(std::time::Duration::from_secs(3600)).await;
}
})
});
Expand Down

0 comments on commit 3e3868b

Please sign in to comment.