[KiCad 6][Variants] Fixed problems crossing alternative drawings

- Units with DeMorgan alternative drawing got only one crossed

Related to #219
This commit is contained in:
Salvador E. Tropea 2022-07-12 07:39:15 -03:00
parent b59a77d900
commit 68c96385d3
1 changed files with 5 additions and 4 deletions

View File

@ -896,15 +896,16 @@ class LibComponent(object):
for c in range(self.unit_count):
name = self.name+"_"+str(c+1)
box = Box()
unit_with_graphs = None
units_with_graphs = []
for unit in self.units:
# Unit 0 is part of unit 1
if unit.name.startswith(name) or (c == 0 and unit.name.startswith(name0)):
box.union(unit.box)
if len(unit.draw):
unit_with_graphs = unit
if unit_with_graphs:
unit_with_graphs.cross_box = box
units_with_graphs.append(unit)
if units_with_graphs:
for u in units_with_graphs:
u.cross_box = box
def write_cross(s, sdata):
""" Add the cross drawing """