forked from 1b-agent/opencadstudio-upstream
fix(web): gate native-only code out of the wasm build
The wasm check broke on the MCP `tools` op, the block library's folder picker and DWG thumbnails, and the PDF export-window culling helpers. Gate each one like the code around it; `read_handle` needs no gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
440adec834
commit
f14b675ff7
4 files changed
+10
-1
No files matched your search
@@ -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<iced::widget::image::Handle> {
|
||||
let img = dwg_thumbnailer::extract(path, MAX_DIM)?;
|
||||
let (w, h) = (img.width(), img.height());
|
||||
|
||||
Reference in new issue
Block a user