forked from 1b-agent/opencadstudio-upstream
fix(blocks): block previews leave out members of other visibility states (#1819)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98cce048c7
commit
c8f67ad35b
1 file changed
+5
-2
@@ -431,7 +431,8 @@ impl Scene {
|
|||||||
|
|
||||||
/// Tessellate one block definition's entities into block-local wire models
|
/// Tessellate one block definition's entities into block-local wire models
|
||||||
/// (insertion base at origin) for the block-palette thumbnail. Nested INSERTs
|
/// (insertion base at origin) for the block-palette thumbnail. Nested INSERTs
|
||||||
/// expand through the block cache. Unknown / empty block → `vec![]`.
|
/// expand through the block cache; invisible members (another visibility
|
||||||
|
/// state) are left out, as on the canvas. Unknown / empty block → `vec![]`.
|
||||||
pub(crate) fn block_preview_wires(&self, name: &str) -> Vec<WireModel> {
|
pub(crate) fn block_preview_wires(&self, name: &str) -> Vec<WireModel> {
|
||||||
use codec::EntityType;
|
use codec::EntityType;
|
||||||
let Some(br) = self.document.block_records.get(name) else {
|
let Some(br) = self.document.block_records.get(name) else {
|
||||||
@@ -442,7 +443,9 @@ impl Scene {
|
|||||||
let Some(e) = self.document.get_entity(eh) else {
|
let Some(e) = self.document.get_entity(eh) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
if matches!(e, EntityType::Block(_) | EntityType::BlockEnd(_)) {
|
if matches!(e, EntityType::Block(_) | EntityType::BlockEnd(_))
|
||||||
|
|| e.common().invisible
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
out.extend(self.tessellate_one(e));
|
out.extend(self.tessellate_one(e));
|
||||||
|
|||||||
Reference in new issue
Block a user