diff --git a/src/app/control/mod.rs b/src/app/control/mod.rs index 5a0a19739..f77225cfd 100644 --- a/src/app/control/mod.rs +++ b/src/app/control/mod.rs @@ -528,6 +528,7 @@ impl OpenCADStudio { Task::none(), ); } + #[cfg(not(target_arch = "wasm32"))] if op == "tools" { return ( json!({ diff --git a/src/app/update/blocks_palette.rs b/src/app/update/blocks_palette.rs index 8c88eb728..003c97c78 100644 --- a/src/app/update/blocks_palette.rs +++ b/src/app/update/blocks_palette.rs @@ -77,6 +77,10 @@ impl OpenCADStudio { BlockPaletteMsg::ToggleOptions => { self.block_palette.options_collapsed ^= true; } + // Browsers expose no folder picker. + #[cfg(target_arch = "wasm32")] + BlockPaletteMsg::LibraryBrowse => {} + #[cfg(not(target_arch = "wasm32"))] BlockPaletteMsg::LibraryBrowse => { return Task::perform( async { diff --git a/src/io/pdf_export.rs b/src/io/pdf_export.rs index e497c5305..27ecc88c1 100644 --- a/src/io/pdf_export.rs +++ b/src/io/pdf_export.rs @@ -945,10 +945,12 @@ fn append_pdf_page( Ok(()) } +#[cfg(not(target_arch = "wasm32"))] /// Slack around the export window, in sheet mm, so a stroke whose centreline /// sits just outside still contributes its width. const CULL_MARGIN_MM: f64 = 10.0; +#[cfg(not(target_arch = "wasm32"))] fn sheet_overlaps(b: [f64; 4], window: [f64; 4]) -> bool { b[0] <= window[2] + CULL_MARGIN_MM && b[2] >= window[0] - CULL_MARGIN_MM @@ -956,6 +958,7 @@ fn sheet_overlaps(b: [f64; 4], window: [f64; 4]) -> bool { && b[3] >= window[1] - CULL_MARGIN_MM } +#[cfg(not(target_arch = "wasm32"))] fn grow(bounds: &mut Option<[f64; 4]>, x: f64, y: f64) { if !x.is_finite() || !y.is_finite() { return; @@ -967,6 +970,7 @@ fn grow(bounds: &mut Option<[f64; 4]>, x: f64, y: f64) { b[3] = b[3].max(y); } +#[cfg(not(target_arch = "wasm32"))] /// Sheet-mm bounds of everything a wire inks (strokes, glyphs, fills). fn wire_sheet_bounds(wire: &WireModel, ox: f64, oy: f64, marker_h: f64) -> Option<[f64; 4]> { let mut bounds = None; @@ -991,6 +995,7 @@ fn wire_sheet_bounds(wire: &WireModel, ox: f64, oy: f64, marker_h: f64) -> Optio bounds } +#[cfg(not(target_arch = "wasm32"))] /// Sheet-mm bounds of a hatch, resolved the way `emit_hatch` places it. fn hatch_sheet_bounds(hatch: &HatchModel, ox: f64, oy: f64) -> Option<[f64; 4]> { let mut bounds = None; diff --git a/src/io/thumbnail.rs b/src/io/thumbnail.rs index bdadfe6c1..be8facc71 100644 --- a/src/io/thumbnail.rs +++ b/src/io/thumbnail.rs @@ -178,7 +178,6 @@ pub fn extract_to_png(input: &std::path::Path, output: &std::path::Path, size: u /// Read a DWG's embedded preview and decode it to an iced image handle for the /// Start page's recent-file thumbnails. `None` for DXF/other files, a missing /// preview, or an undecodable format (WMF). -#[cfg(not(target_arch = "wasm32"))] pub fn read_handle(path: &std::path::Path) -> Option { let img = dwg_thumbnailer::extract(path, MAX_DIM)?; let (w, h) = (img.width(), img.height());