Skip to content

Commit fbfa7f6

Browse files
Merge pull request #305 from robotools/justvanrossum-patch-1
Pass flags down when copying the data
2 parents 4472818 + 53becc7 commit fbfa7f6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/fontMath/mathGlyph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __ne__(self, other):
131131

132132
def copy(self):
133133
"""return a new MathGlyph containing all data in self"""
134-
return MathGlyph(self)
134+
return MathGlyph(self, scaleComponentTransform=self.scaleComponentTransform, strict=self.strict)
135135

136136
def copyWithoutMathSubObjects(self):
137137
"""
@@ -143,7 +143,7 @@ def copyWithoutMathSubObjects(self):
143143
144144
this is used mainly for internal glyph math.
145145
"""
146-
n = MathGlyph(None)
146+
n = MathGlyph(None, scaleComponentTransform=self.scaleComponentTransform, strict=self.strict)
147147
n.name = self.name
148148
if self.unicodes is not None:
149149
n.unicodes = list(self.unicodes)

Lib/fontMath/test/test_mathGlyph.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ def test_image_round(self):
509509
glyph2 = glyph1.round()
510510
self.assertEqual(glyph2.image, expected)
511511

512+
def test_copy(self):
513+
glyph1 = self._setupTestGlyph()
514+
glyph1.unicodes = []
515+
glyph2 = glyph1.copy()
516+
self.assertEqual(glyph1, glyph2)
517+
512518

513519
class MathGlyphPenTest(unittest.TestCase):
514520
def __init__(self, methodName):

0 commit comments

Comments
 (0)