From b21428c0ea29452e3edc5a11f72fa3e614ea617e Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Tue, 11 Jun 2019 20:24:45 +0200 Subject: Remove the WebInterface directory and create webhogg project folder --- WebInterface/wasm/asm-paint/src/site.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 WebInterface/wasm/asm-paint/src/site.rs (limited to 'WebInterface/wasm/asm-paint/src/site.rs') diff --git a/WebInterface/wasm/asm-paint/src/site.rs b/WebInterface/wasm/asm-paint/src/site.rs deleted file mode 100644 index 4ae0237..0000000 --- a/WebInterface/wasm/asm-paint/src/site.rs +++ /dev/null @@ -1,28 +0,0 @@ -use web_sys; -use crate::canvas::Canvas; - -pub struct Site { - window: web_sys::Window, - document: web_sys::Document, -} - -impl Site { - pub fn from_current() -> Option { - let window = web_sys::window() - .or_else(|| {error!("unable to query window"); None})?; - let document = window.document() - .or_else(|| {error!("unable to query document"); None})?; - Some(Self { - window, document - }) - } - - pub fn create_canvas(&self) -> Option { - debug!("gain canvas element"); - let element = self.document.get_element_by_id("canvas") - .or_else(|| {error!("could not gain canvas element"); None})?; - Canvas::new(element) - .or_else(|| {error!("could not create a webgl2 canvas. - Your browser doesn't seem to support webgl2"); None}) - } -} -- cgit v1.2.3-70-g09d2