[PCB Print][KiCad 7] Adapted to the new ZONE.GetFirstLayer()

This commit is contained in:
Salvador E. Tropea 2023-02-14 13:17:09 -03:00
parent 4cf7eb0bad
commit aa9826fe88
2 changed files with 6 additions and 2 deletions

View File

@ -340,6 +340,10 @@ class GS(object):
return layers.Contains(id)
return id in layers.Seq()
@staticmethod
def zone_get_first_layer(e):
return e.GetFirstLayer() if GS.ki7 else e.GetLayer()
@staticmethod
def expand_text_variables(text, extra_vars=None):
vars = GS.load_pro_variables()

View File

@ -584,7 +584,7 @@ class PCB_PrintOptions(VariantOptions):
removed.append(e)
found = True
# But this isn't enough if the zone is only one layer, move it to another
if e.GetLayer() == id:
if GS.zone_get_first_layer(e) == id:
e.SetLayer(tmp_layer)
moved.append(e)
found = True
@ -654,7 +654,7 @@ class PCB_PrintOptions(VariantOptions):
removed.append(e)
found = True
# But this isn't enough if the zone is only one layer, move it to another
if e.GetLayer() == id:
if GS.zone_get_first_layer(e) == id:
e.SetLayer(tmp_layer)
moved.append(e)
found = True