cleanup
This commit is contained in:
parent
c45386e05a
commit
6b500292a3
@ -22,10 +22,13 @@ lto = true
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
meval = { git = "https://github.com/Titaniumtown/meval-rs.git" }
|
meval = { git = "https://github.com/Titaniumtown/meval-rs.git" }
|
||||||
eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false, features = ["egui_glow"] }
|
eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false, features = ["egui_glow"] }
|
||||||
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
|
|
||||||
git-version = "0.3.5"
|
git-version = "0.3.5"
|
||||||
|
|
||||||
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
|
instant = { version = "0.1.12" }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
instant = { version = "0.1.12", features = ["wasm-bindgen"] }
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
wee_alloc = "0.4.5"
|
wee_alloc = "0.4.5"
|
||||||
wasm-bindgen = { version = "0.2.79", default-features = false, features = ["std"] }
|
wasm-bindgen = { version = "0.2.79", default-features = false, features = ["std"] }
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use eframe::{egui, epi};
|
|||||||
use egui::plot::{Line, Plot, Values};
|
use egui::plot::{Line, Plot, Values};
|
||||||
use egui::widgets::plot::BarChart;
|
use egui::widgets::plot::BarChart;
|
||||||
use egui::widgets::Button;
|
use egui::widgets::Button;
|
||||||
use egui::{Color32, Vec2, FontData, FontFamily};
|
use egui::{Color32, FontData, FontFamily, Vec2};
|
||||||
use git_version::git_version;
|
use git_version::git_version;
|
||||||
|
|
||||||
// Grabs git version on compile time
|
// Grabs git version on compile time
|
||||||
@ -83,18 +83,12 @@ impl epi::App for MathApp {
|
|||||||
"Ubuntu-Light".to_owned(),
|
"Ubuntu-Light".to_owned(),
|
||||||
FontData::from_static(include_bytes!("Ubuntu-Light.ttf")),
|
FontData::from_static(include_bytes!("Ubuntu-Light.ttf")),
|
||||||
);
|
);
|
||||||
fonts.families.insert(
|
fonts
|
||||||
FontFamily::Monospace,
|
.families
|
||||||
vec![
|
.insert(FontFamily::Monospace, vec!["Ubuntu-Light".to_owned()]);
|
||||||
"Ubuntu-Light".to_owned(),
|
fonts
|
||||||
],
|
.families
|
||||||
);
|
.insert(FontFamily::Proportional, vec!["Ubuntu-Light".to_owned()]);
|
||||||
fonts.families.insert(
|
|
||||||
FontFamily::Proportional,
|
|
||||||
vec![
|
|
||||||
"Ubuntu-Light".to_owned(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
ctx.set_fonts(fonts);
|
ctx.set_fonts(fonts);
|
||||||
|
|
||||||
|
|||||||
@ -52,15 +52,15 @@ impl Clone for Function {
|
|||||||
Self {
|
Self {
|
||||||
function: Box::new(func),
|
function: Box::new(func),
|
||||||
func_str: self.func_str.clone(),
|
func_str: self.func_str.clone(),
|
||||||
min_x: self.min_x.clone(),
|
min_x: self.min_x,
|
||||||
max_x: self.max_x.clone(),
|
max_x: self.max_x,
|
||||||
pixel_width: self.pixel_width.clone(),
|
pixel_width: self.pixel_width,
|
||||||
back_cache: self.back_cache.clone(),
|
back_cache: self.back_cache.clone(),
|
||||||
front_cache: self.front_cache.clone(),
|
front_cache: self.front_cache.clone(),
|
||||||
integral: self.integral.clone(),
|
integral: self.integral,
|
||||||
integral_min_x: self.integral_min_x.clone(),
|
integral_min_x: self.integral_min_x,
|
||||||
integral_max_x: self.integral_max_x.clone(),
|
integral_max_x: self.integral_max_x,
|
||||||
integral_num: self.integral_num.clone(),
|
integral_num: self.integral_num,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ impl Function {
|
|||||||
.clone()
|
.clone()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|ele| (ele.x >= min_x) && (min_x >= ele.x))
|
.filter(|ele| (ele.x >= min_x) && (min_x >= ele.x))
|
||||||
.map(|ele| *ele)
|
.copied()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let x_to_go = match movement_right {
|
let x_to_go = match movement_right {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ fn init_tracing_wasm() {
|
|||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
fn init_tracing_wasm() { }
|
fn init_tracing_wasm() {}
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user