mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-10 14:40:57 +08:00
Bezier-rs: add Tangents/Normals to Point functions (#1547)
* Add tangent/normal to point to bézier-rs * Add license information and general cleanup * Bump version * Add iframe demos --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
c14c6fbe93
commit
6a10bcc3fc
@@ -4,7 +4,9 @@ mod svg_drawing;
|
||||
mod utils;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
pub static LOGGER: WasmLog = WasmLog;
|
||||
thread_local! { pub static HAS_CRASHED: std::cell::RefCell<bool> = std::cell::RefCell::new(false); }
|
||||
|
||||
/// Initialize the backend
|
||||
#[wasm_bindgen(start)]
|
||||
@@ -12,6 +14,16 @@ pub fn init() {
|
||||
// Set up the logger with a default level of debug
|
||||
log::set_logger(&LOGGER).expect("Failed to set logger");
|
||||
log::set_max_level(log::LevelFilter::Trace);
|
||||
|
||||
fn panic_hook(info: &core::panic::PanicInfo) {
|
||||
// Skip if we have already panicked
|
||||
if HAS_CRASHED.with(|cell| cell.replace(true)) {
|
||||
return;
|
||||
}
|
||||
log::error!("{}", info);
|
||||
}
|
||||
|
||||
std::panic::set_hook(Box::new(panic_hook));
|
||||
}
|
||||
|
||||
/// Logging to the JS console
|
||||
|
||||
Reference in New Issue
Block a user