From 468d1e4f43beb2c8acf0782ecb003e76ff50cb8f Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Tue, 13 Oct 2026 08:18:37 +0300 Subject: [PATCH] fix(plot): honour the requested plot style over the layout's own A headless plot with plot_style loaded the layout's stored page setup, which put the layout's CTB back in place and, when that file was not in the plot styles folder, failed the plot with "not loaded". The requested table now stays active for every page. Bump codec ddf0fd2 (viewport on state from DXF group 68, so viewports written without bit 0x8000 show their contents), kernel b80079a, graph 45c9649. Refs #1739 Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 8 ++++---- Cargo.toml | 8 ++++---- crates/ocs_plugin_api/Cargo.toml | 4 ++-- crates/ocs_save/Cargo.toml | 2 +- crates/ocs_web_worker/Cargo.toml | 2 +- plugins/opencad-python/Cargo.lock | 2 +- src/app/control/actions.rs | 9 +++++++++ 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89ec7725b..3bde24513 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4216,7 +4216,7 @@ dependencies = [ [[package]] name = "opencadcodec" version = "0.6.0" -source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=8aa574a#8aa574a5c0db331a3c55de3fc1e670338146d4e3" +source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=ddf0fd2#ddf0fd2d7541bebce137c1bf960db54fcd12bcd2" dependencies = [ "anyhow", "bitflags 2.13.1", @@ -4239,7 +4239,7 @@ dependencies = [ [[package]] name = "opencadgraph" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/opencadgraph.git?rev=4810ee0#4810ee000d17aaa0492842cc7da3772f8b6be389" +source = "git+https://github.com/HakanSeven12/opencadgraph.git?rev=45c9649#45c96493fb55d8825561bca9e9d7e5e700dcd3fa" dependencies = [ "opencadkernel", "serde_json", @@ -4248,7 +4248,7 @@ dependencies = [ [[package]] name = "opencadkernel" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=d79bb30#d79bb302c1d0067d3af275459a794a2f9e806b55" +source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=b80079a#b80079a1e61b3f3519dc759e6553761e24787f67" dependencies = [ "cavalier_contours", "opencadcodec", @@ -4259,7 +4259,7 @@ dependencies = [ [[package]] name = "opencadkernel-constraints" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=d79bb30#d79bb302c1d0067d3af275459a794a2f9e806b55" +source = "git+https://github.com/HakanSeven12/opencadkernel.git?rev=b80079a#b80079a1e61b3f3519dc759e6553761e24787f67" dependencies = [ "nalgebra", ] diff --git a/Cargo.toml b/Cargo.toml index a45d247df..2b3fcae25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,10 +35,10 @@ rfd = "0.17" clap = { version = "4", features = ["derive", "string"] } env_logger = "0.11" log = "0.4" -codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "8aa574a", features = ["serde"] } -kernel = { package = "opencadkernel", git = "https://github.com/HakanSeven12/opencadkernel.git", rev = "d79bb30", features = ["acis", "offset"] } -kernel-constraints = { package = "opencadkernel-constraints", git = "https://github.com/HakanSeven12/opencadkernel.git", rev = "d79bb30" } -graph = { package = "opencadgraph", git = "https://github.com/HakanSeven12/opencadgraph.git", rev = "4810ee0" } +codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "ddf0fd2", features = ["serde"] } +kernel = { package = "opencadkernel", git = "https://github.com/HakanSeven12/opencadkernel.git", rev = "b80079a", features = ["acis", "offset"] } +kernel-constraints = { package = "opencadkernel-constraints", git = "https://github.com/HakanSeven12/opencadkernel.git", rev = "b80079a" } +graph = { package = "opencadgraph", git = "https://github.com/HakanSeven12/opencadgraph.git", rev = "45c9649" } dwg-thumbnailer = { path = "crates/dwg-thumbnailer" } # Shared SAVE serialization dispatch + web-worker wire format: one # implementation for the inline (fallback/native) path and the worker path. diff --git a/crates/ocs_plugin_api/Cargo.toml b/crates/ocs_plugin_api/Cargo.toml index 3efb09351..afe9c60ae 100644 --- a/crates/ocs_plugin_api/Cargo.toml +++ b/crates/ocs_plugin_api/Cargo.toml @@ -15,7 +15,7 @@ serde_json = { version = "1", optional = true } # Pulled in only by the `host` feature, which adds the `opencadcodec`-typed # `HostApi` runtime surface. The default crate stays dependency-free so engine # crates and external tooling can depend on the manifest/ribbon contract cheaply. -codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "8aa574a", optional = true, features = ["serde"] } +codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "ddf0fd2", optional = true, features = ["serde"] } # Runtime IPC and serialization (host feature only). interprocess = { version = "2", optional = true } @@ -39,7 +39,7 @@ serde_json = "1" serde = { version = "1", features = ["derive"] } cargo-lock = "11" # opencadcodec is scanned at build time to generate the embedded type registry. -codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "8aa574a", features = ["serde"] } +codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "ddf0fd2", features = ["serde"] } [dev-dependencies] serde_json = "1" diff --git a/crates/ocs_save/Cargo.toml b/crates/ocs_save/Cargo.toml index 5818b95bf..43971aea4 100644 --- a/crates/ocs_save/Cargo.toml +++ b/crates/ocs_save/Cargo.toml @@ -10,6 +10,6 @@ publish = false # exactly one implementation. No UI/app dependencies — only the codec + serde. [dependencies] -codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "8aa574a", features = ["serde"] } +codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "ddf0fd2", features = ["serde"] } bincode = "1.3" serde = { version = "1", features = ["derive"] } diff --git a/crates/ocs_web_worker/Cargo.toml b/crates/ocs_web_worker/Cargo.toml index 894415a19..ec625d638 100644 --- a/crates/ocs_web_worker/Cargo.toml +++ b/crates/ocs_web_worker/Cargo.toml @@ -8,7 +8,7 @@ publish = false crate-type = ["cdylib"] [dependencies] -codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "8aa574a", features = ["serde"] } +codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "ddf0fd2", features = ["serde"] } bincode = "1.3" serde = { version = "1", features = ["derive"] } console_error_panic_hook = "0.1" diff --git a/plugins/opencad-python/Cargo.lock b/plugins/opencad-python/Cargo.lock index 8e13b651e..dff6bbdf1 100644 --- a/plugins/opencad-python/Cargo.lock +++ b/plugins/opencad-python/Cargo.lock @@ -1264,7 +1264,7 @@ dependencies = [ [[package]] name = "opencadcodec" version = "0.6.0" -source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=8aa574a#8aa574a5c0db331a3c55de3fc1e670338146d4e3" +source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=ddf0fd2#ddf0fd2d7541bebce137c1bf960db54fcd12bcd2" dependencies = [ "anyhow", "bitflags", diff --git a/src/app/control/actions.rs b/src/app/control/actions.rs index b2e0acb7f..feaba9171 100644 --- a/src/app/control/actions.rs +++ b/src/app/control/actions.rs @@ -699,6 +699,15 @@ impl OpenCADStudio { if req.get("upside_down").is_some() { page_dialog.upside_down = request.upside_down; } + // The requested table wins over the layout's own, which + // the stored page setup just loaded (or failed to find). + if let Some(table) = &loaded_style { + app.active_plot_style = Some(table.clone()); + page_dialog.style_name = table.name.clone(); + page_dialog.apply_plot_styles = true; + page_dialog.style_missing = false; + page_dialog.style_error = None; + } } app.plot_dialog = page_dialog; if app.plot_dialog.area == "Display" {