forked from 1b-agent/opencadstudio-upstream
fix(blocks): prevent circular block nesting and cut render cycles
Introduce would_create_cycle in block_service to prevent recursive block definitions with case-insensitive matching across block records. Enforce cycle refusal at INSERT commit in BEDIT and during block redefinition (redefine_block_raw) with a shared error message. Ensure render-time recursion truncates safely with a one-time session warning on cyclic documents.
This commit is contained in:
1 parent
59bb6faabd
commit
9c08e8a3ed
8 files changed
+435
-24
No files matched your search
@@ -580,11 +580,14 @@ impl OpenCADStudio {
|
||||
.define_block_raw(&def.name, def.base_point, def.entities);
|
||||
}
|
||||
if redefine {
|
||||
self.tabs[i].scene.redefine_block_raw(
|
||||
if let Err(err) = self.tabs[i].scene.redefine_block_raw(
|
||||
&name,
|
||||
codec::types::Vector3::new(base.x, base.y, base.z),
|
||||
entities,
|
||||
);
|
||||
) {
|
||||
self.command_line.push_error(&err);
|
||||
return Err(err);
|
||||
}
|
||||
} else {
|
||||
self.tabs[i]
|
||||
.scene
|
||||
|
||||
Reference in new issue
Block a user