forked from 1b-agent/opencadstudio-upstream
Cargo: codec e023bc3 (acadrust sync), kernel abca4e8, graph c63556f
The codec now holds wide EntityType variants boxed (MText, Helix, Dimension, Hatch, Viewport, MultiLeader, Surface, Table, Ole2Frame, Light, Extended). Constructors box their entity; nested patterns reach a dimension through entities::dimension::as_dimension(_mut). Also follows BlockAction::action_ids, LineTypeComplexData::source_flags and the decimal tab stop with an explicit character. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
218150c76a
commit
e4d04ef132
87 files changed
+380
-269
No files matched your search
@@ -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 = "102f04c", optional = true, features = ["serde"] }
|
||||
codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "e023bc3", 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 = "102f04c", features = ["serde"] }
|
||||
codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "e023bc3", features = ["serde"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1"
|
||||
@@ -3583,7 +3583,7 @@ mod tests {
|
||||
#[test]
|
||||
fn unsupported_canvas_kind_has_typed_snapshot_fields() {
|
||||
use crate::host::codec;
|
||||
let hatch = codec::EntityType::Hatch(codec::entities::Hatch::default());
|
||||
let hatch = codec::EntityType::Hatch(Box::new(codec::entities::Hatch::default()));
|
||||
let snapshot = entity_snapshot(&hatch).unwrap();
|
||||
let fields = snapshot
|
||||
.get("Hatch")
|
||||
@@ -3713,7 +3713,7 @@ mod tests {
|
||||
#[test]
|
||||
fn canvas_layer_patch_preserves_unmapped_hatch_fields() {
|
||||
use crate::host::codec;
|
||||
let hatch = codec::EntityType::Hatch(codec::entities::Hatch::default());
|
||||
let hatch = codec::EntityType::Hatch(Box::new(codec::entities::Hatch::default()));
|
||||
let patched = patch_canvas_layer(&hatch, "HATCHES").unwrap();
|
||||
assert_eq!(patched.common().layer, "HATCHES");
|
||||
assert_eq!(hatch.common().layer, "0");
|
||||
@@ -3809,13 +3809,13 @@ mod tests {
|
||||
}));
|
||||
}
|
||||
hatch.paths.push(path);
|
||||
let entity = codec::EntityType::Hatch(hatch.clone());
|
||||
let entity = codec::EntityType::Hatch(Box::new(hatch.clone()));
|
||||
validate_new_canvas_entity(&entity).unwrap();
|
||||
|
||||
let mut invalid = hatch.clone();
|
||||
invalid.paths.clear();
|
||||
assert!(
|
||||
validate_new_canvas_entity(&codec::EntityType::Hatch(invalid))
|
||||
validate_new_canvas_entity(&codec::EntityType::Hatch(Box::new(invalid)))
|
||||
.unwrap_err()
|
||||
.contains("at least one boundary path")
|
||||
);
|
||||
@@ -3824,7 +3824,7 @@ mod tests {
|
||||
invalid.is_solid = false;
|
||||
invalid.pattern_scale = 0.0;
|
||||
assert!(
|
||||
validate_new_canvas_entity(&codec::EntityType::Hatch(invalid))
|
||||
validate_new_canvas_entity(&codec::EntityType::Hatch(Box::new(invalid)))
|
||||
.unwrap_err()
|
||||
.contains("greater than zero")
|
||||
);
|
||||
@@ -3841,13 +3841,13 @@ mod tests {
|
||||
associative.paths[0].boundary_handles.push(boundary);
|
||||
validate_canvas_entity_references(
|
||||
&document,
|
||||
&codec::EntityType::Hatch(associative.clone()),
|
||||
&codec::EntityType::Hatch(Box::new(associative.clone())),
|
||||
)
|
||||
.unwrap();
|
||||
associative.paths[0].boundary_handles[0] = codec::Handle::new(u64::MAX);
|
||||
assert!(validate_canvas_entity_references(
|
||||
&document,
|
||||
&codec::EntityType::Hatch(associative),
|
||||
&codec::EntityType::Hatch(Box::new(associative)),
|
||||
)
|
||||
.unwrap_err()
|
||||
.contains("does not exist"));
|
||||
|
||||
@@ -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 = "102f04c", features = ["serde"] }
|
||||
codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "e023bc3", features = ["serde"] }
|
||||
bincode = "1.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
@@ -8,7 +8,7 @@ publish = false
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "102f04c", features = ["serde"] }
|
||||
codec = { package = "opencadcodec", git = "https://github.com/HakanSeven12/opencadcodec.git", rev = "e023bc3", features = ["serde"] }
|
||||
bincode = "1.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
console_error_panic_hook = "0.1"
|
||||
|
||||
Reference in new issue
Block a user