Skip to content

Commit be6d9e2

Browse files
authored
Merge pull request #1 from catilac/build_target_logic_for_wasm
image_load build config logic
2 parents 839f049 + 3e6de20 commit be6d9e2

File tree

1 file changed

+2
-5
lines changed
  • crates/processing_render/src

1 file changed

+2
-5
lines changed

crates/processing_render/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,7 @@ pub fn surface_create(
345345

346346
/// Create a WebGPU surface from a canvas element ID
347347
#[cfg(target_arch = "wasm32")]
348-
pub fn surface_create_from_canvas(
349-
canvas_id: &str,
350-
width: u32,
351-
height: u32,
352-
) -> Result<Entity> {
348+
pub fn surface_create_from_canvas(canvas_id: &str, width: u32, height: u32) -> Result<Entity> {
353349
use wasm_bindgen::JsCast;
354350
use web_sys::HtmlCanvasElement;
355351

@@ -630,6 +626,7 @@ pub fn image_create(
630626
app_mut(|app| Ok(image::create(app.world_mut(), size, data, texture_format)))
631627
}
632628

629+
#[cfg(not(target_arch = "wasm32"))]
633630
pub fn image_load(path: &str) -> Result<Entity> {
634631
let path = PathBuf::from(path);
635632
app_mut(|app| image::load(app.world_mut(), path))

0 commit comments

Comments
 (0)