Skip to content

Commit

Permalink
cleanup dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Titaniumtown committed Nov 20, 2023
1 parent 0087bcf commit ac30543
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 49 deletions.
26 changes: 14 additions & 12 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 4 additions & 6 deletions src/function_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 35 additions & 28 deletions src/function_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/widgets.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::misc::Offset;
use egui::{Id, InnerResponse};

/// Creates an area ontop of a widget with an y offset
Expand Down

0 comments on commit ac30543

Please sign in to comment.