fix(web): honor selected DWG/DXF version when saving

The web save path discarded the chosen format version (`let _ = version`)
and `save_to_bytes` never applied it, so every browser download was
written at the document's default version (AC1032 / DWG 2018) regardless
of the format picked in the Save dialog. (#122)

Thread `version` into `save_to_bytes` and set `doc.version` there, the
byte-buffer counterpart to `save_as_version`. Saving as DWG 2013 now
writes an AC1027 file.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-18 13:46:55 +03:00
1 parent da7905db61
commit aafced76d7
2 files changed
+11 -5

No files matched your search

+1 -2
View File
@@ -976,8 +976,7 @@ impl OpenCADStudio {
}
#[cfg(target_arch = "wasm32")]
{
let _ = version;
match crate::io::save_to_bytes(&self.tabs[i].scene.document, ext) {
match crate::io::save_to_bytes(&self.tabs[i].scene.document, ext, version) {
Ok(bytes) => {
crate::sys::download_bytes(&filename, &bytes);
self.tabs[i].dirty = false;