fix
This commit is contained in:
parent
f2191b26ed
commit
74b7952cb5
@ -21,7 +21,7 @@ lto = false
|
||||
|
||||
[dependencies]
|
||||
meval = { git = "https://github.com/Titaniumtown/meval-rs.git" }
|
||||
eframe = { git = "https://github.com/Titaniumtown/egui", default-features = false, features = ["egui_glow"] }
|
||||
eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false, features = ["egui_glow"] }
|
||||
git-version = "0.3.5"
|
||||
include-flate = { git = "https://github.com/Titaniumtown/include-flate.git" }
|
||||
|
||||
|
||||
@ -251,17 +251,17 @@ impl epi::App for MathApp {
|
||||
|
||||
for (i, function) in self.functions.iter_mut().enumerate() {
|
||||
let mut integral_toggle: bool = false;
|
||||
|
||||
let integral_enabled = function.integral;
|
||||
// Entry for a function
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Function: ");
|
||||
let mut integral_opt_text = "Integrate";
|
||||
if function.integral {
|
||||
integral_opt_text = "Don't integrate";
|
||||
}
|
||||
if ui
|
||||
.add(Button::new("∫"))
|
||||
.on_hover_text(integral_opt_text)
|
||||
.on_hover_text(if integral_enabled {
|
||||
"Don't integrate"
|
||||
} else {
|
||||
"Integrate"
|
||||
})
|
||||
.clicked()
|
||||
{
|
||||
integral_toggle = true;
|
||||
@ -270,9 +270,9 @@ impl epi::App for MathApp {
|
||||
});
|
||||
|
||||
let integral: bool = if integral_toggle {
|
||||
!function.integral
|
||||
!integral_enabled
|
||||
} else {
|
||||
function.integral
|
||||
integral_enabled
|
||||
};
|
||||
|
||||
if !self.func_strs[i].is_empty() {
|
||||
|
||||
@ -35,9 +35,7 @@ pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
||||
|
||||
// Used in order to hook into `panic!()` to log in the browser's console
|
||||
log_helper("Initializing panic hooks...");
|
||||
std::panic::set_hook(Box::new(|panic_info| {
|
||||
console_error_panic_hook::hook(panic_info);
|
||||
}));
|
||||
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
|
||||
log_helper("Initialized panic hooks!");
|
||||
|
||||
log_helper("Finished initializing!");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user