diff --git a/Cargo.lock b/Cargo.lock index cb522a4..d23e21e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,7 +660,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "ecolor" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "bytemuck", "serde", @@ -669,7 +669,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "bytemuck", "cocoa", @@ -698,7 +698,7 @@ dependencies = [ [[package]] name = "egui" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "accesskit", "ahash", @@ -711,7 +711,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "arboard", "egui", @@ -726,7 +726,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "bytemuck", "egui", @@ -740,7 +740,7 @@ dependencies = [ [[package]] name = "egui_plot" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "egui", ] @@ -754,7 +754,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "bytemuck", "serde", @@ -774,7 +774,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.23.0" -source = "git+https://github.com/titaniumtown/egui.git#7e1052b6dd898f07e0fbcaf8acb8966f8c6d027a" +source = "git+https://github.com/titaniumtown/egui.git#8caeeb3e9a47c37245aa7f5d3d3e31092ae18787" dependencies = [ "ab_glyph", "ahash", @@ -1354,7 +1354,8 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lol_alloc" version = "0.4.0" -source = "git+https://github.com/Craig-Macomber/lol_alloc#ed72a23610f232d492290a90fee544efdc0fd822" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36aabc32b791f1a506e0bb90e0fa03e983500549d7b1f2dad45b5fc20ef45974" dependencies = [ "spin", ] @@ -2104,9 +2105,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.24" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno", @@ -2118,7 +2119,8 @@ dependencies = [ [[package]] name = "ruzstd" version = "0.5.0" -source = "git+https://github.com/KillingSpark/zstd-rs.git#f7e99753b991dd7737f5250a2270ae00be42cd8f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 7bebf9f..16916ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ egui_plot = { git = "https://github.com/titaniumtown/egui.git", default-features shadow-rs = { version = "0.12", default-features = false } const_format = { version = "0.2", default-features = false, features = ["fmt"] } cfg-if = "1" -ruzstd = { git = "https://github.com/KillingSpark/zstd-rs.git" } +ruzstd = "0.5" tracing = "0.1" itertools = "0.10" static_assertions = "1.1" @@ -83,8 +83,7 @@ getrandom = { version = "0.2" } [target.'cfg(target_arch = "wasm32")'.dependencies] instant = { version = "0.1", features = ["wasm-bindgen"] } -#wee_alloc = "0.4" -lol_alloc = { git = "https://github.com/Craig-Macomber/lol_alloc" } +lol_alloc = "0.4.0" wasm-bindgen = { version = "0.2", default-features = false, features = ["std"] } web-sys = "0.3" tracing-wasm = "0.2" diff --git a/src/function_entry.rs b/src/function_entry.rs index 740a7a7..989ec47 100644 --- a/src/function_entry.rs +++ b/src/function_entry.rs @@ -418,12 +418,10 @@ impl FunctionEntry { ); } - if self.nth_derviative && let Some(ref nth_derviative) = self.nth_derivative_data { - plot_ui.line( - nth_derviative.clone() - .to_line() - .color(Color32::DARK_RED) - ); + if self.nth_derviative + && let Some(ref nth_derviative) = self.nth_derivative_data + { + plot_ui.line(nth_derviative.clone().to_line().color(Color32::DARK_RED)); } // Plot integral data diff --git a/src/function_manager.rs b/src/function_manager.rs index 2b23ba9..0334b78 100644 --- a/src/function_manager.rs +++ b/src/function_manager.rs @@ -148,34 +148,41 @@ impl FunctionManager { // Register movement and apply proper changes function.autocomplete.register_movement(&movement); - if movement != Movement::Complete && let Some(hints) = function.autocomplete.hint.many() { - // Doesn't need to have a number in id as there should only be 1 autocomplete popup in the entire gui - - // hashed "autocomplete_popup" - const POPUP_ID: Id = create_id(7574801616484505465); - - let mut clicked = false; - - egui::popup_below_widget(ui, POPUP_ID, &re, |ui| { - hints.iter().enumerate().for_each(|(i, candidate)| { - if ui.selectable_label(i == function.autocomplete.i, *candidate).clicked() { - clicked = true; - function.autocomplete.i = i; - } - }); - }); - - if clicked { - function.autocomplete.apply_hint(hints[function.autocomplete.i]); - - // Don't need this here as it simply won't be display next frame - // ui.memory_mut().close_popup(); - - movement = Movement::Complete; - } else { - ui.memory_mut(|x| x.open_popup(POPUP_ID)); - } - } + if movement != Movement::Complete + && let Some(hints) = function.autocomplete.hint.many() + { + // Doesn't need to have a number in id as there should only be 1 autocomplete popup in the entire gui + + // hashed "autocomplete_popup" + const POPUP_ID: Id = create_id(7574801616484505465); + + let mut clicked = false; + + egui::popup_below_widget(ui, POPUP_ID, &re, |ui| { + hints.iter().enumerate().for_each(|(i, candidate)| { + if ui + .selectable_label(i == function.autocomplete.i, *candidate) + .clicked() + { + clicked = true; + function.autocomplete.i = i; + } + }); + }); + + if clicked { + function + .autocomplete + .apply_hint(hints[function.autocomplete.i]); + + // Don't need this here as it simply won't be display next frame + // ui.memory_mut().close_popup(); + + movement = Movement::Complete; + } else { + ui.memory_mut(|x| x.open_popup(POPUP_ID)); + } + } // Push cursor to end if needed if movement == Movement::Complete { diff --git a/src/widgets.rs b/src/widgets.rs index 32de119..a6d1df6 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -1,3 +1,4 @@ +use crate::misc::Offset; use egui::{Id, InnerResponse}; /// Creates an area ontop of a widget with an y offset