diff --git a/Lib/glyphsLib/classes.py b/Lib/glyphsLib/classes.py index b46fdc5b6..65b3304d2 100755 --- a/Lib/glyphsLib/classes.py +++ b/Lib/glyphsLib/classes.py @@ -4125,7 +4125,7 @@ def _serialize_to_plist(self, writer): userData = dict(self.userData) - if self.layerId != self.associatedMasterId: + if not self.isMasterLayer: writer.writeObjectKeyValue(self, "associatedMasterId") if writer.formatVersion > 2: attributes = self._get_plist_attributes() @@ -4152,9 +4152,9 @@ def _serialize_to_plist(self, writer): writer.writeObjectKeyValue(self, "metricRight") writer.writeObjectKeyValue(self, "metricWidth") if ( - self.name is not None - and len(self.name) > 0 - and self.layerId != self.associatedMasterId + self._name is not None + and len(self._name) > 0 + and not self.isMasterLayer ): writer.writeObjectKeyValue(self, "name") if writer.formatVersion > 2: @@ -4482,6 +4482,9 @@ def leftMetricsKey(self, value): def widthMetricsKey(self, value): self.metricWidth = value + def isMasterLayer(self): + return self.layerId == self.associatedMasterId + def isBracketLayer(self): return LAYER_ATTRIBUTE_AXIS_RULES in self.attributes