This commit is contained in:
Simon Gardling 2023-03-07 13:12:57 -05:00
parent d134e918e4
commit 9a5cb8e5f8
5 changed files with 13 additions and 13 deletions

5
Cargo.lock generated
View File

@ -1717,9 +1717,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
name = "orbclient"
version = "0.3.42"
version = "0.3.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba683f1641c11041c59d5d93689187abcab3c1349dc6d9d70c550c9f9360802f"
checksum = "974465c5e83cf9df05c1e4137b271d29035c902e39e5ad4c1939837e22160af8"
dependencies = [
"cfg-if",
"redox_syscall 0.2.16",
@ -3127,6 +3127,7 @@ dependencies = [
"tracing-subscriber",
"tracing-wasm",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"zstd",
]

View File

@ -82,6 +82,7 @@ wasm-bindgen = { version = "0.2", default-features = false, features = ["std"] }
web-sys = "0.3"
tracing-wasm = "0.2"
getrandom = { version = "0.2", features = ["js"] }
wasm-bindgen-futures = "0.4.34"
[package.metadata.cargo-all-features]
skip_optional_dependencies = true #don't test optional dependencies, only features

View File

@ -42,22 +42,20 @@ cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
use wasm_bindgen::prelude::*;
use lol_alloc::FreeListAllocator;
use lol_alloc::{FreeListAllocator, LockedAllocator};
#[global_allocator]
static ALLOCATOR: FreeListAllocator = FreeListAllocator::new();
static ALLOCATOR: LockedAllocator<FreeListAllocator> = LockedAllocator::new(FreeListAllocator::new());
#[wasm_bindgen(start)]
pub fn start() -> Result<(), wasm_bindgen::JsValue> {
pub async fn start() {
tracing::info!("Starting...");
// Used in order to hook into `panic!()` to log in the browser's console
tracing_wasm::set_as_global_default();
eframe::start_web("canvas", eframe::WebOptions {
follow_system_theme: false,
default_theme: eframe::Theme::Dark
},
Box::new(|cc| Box::new(math_app::MathApp::new(cc))))
eframe::start_web("canvas", eframe::WebOptions::default(),
Box::new(|cc| Box::new(math_app::MathApp::new(cc)))).await.unwrap();
}
}
}

View File

@ -140,9 +140,7 @@ impl MathApp {
if #[cfg(target_arch = "wasm32")] {
use core::intrinsics::assume;
if let Some(web_info) = &cc.integration_info.web_info {
tracing::info!("Web Info: {:?}", web_info);
}
tracing::info!("Web Info: {:?}", &cc.integration_info.web_info);
fn get_storage_decompressed() -> Option<Vec<u8>> {
let data = get_localstorage().get_item(DATA_NAME).ok()??;

View File

@ -46,6 +46,8 @@
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
height: 100%;
width: 100%;
}
/* Position canvas in center-top: */