glyf: setCoordinates must not modify input coord parameter

make a copy instead
This commit is contained in:
Cosimo Lupo 2019-04-02 10:45:36 +01:00
parent fb914c93c4
commit a571eee8d6
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642

View File

@ -379,8 +379,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
topSideY = coord[-2][1] topSideY = coord[-2][1]
bottomSideY = coord[-1][1] bottomSideY = coord[-1][1]
for _ in range(4): coord = coord[:-4]
del coord[-1]
if glyph.isComposite(): if glyph.isComposite():
assert len(coord) == len(glyph.components) assert len(coord) == len(glyph.components)
@ -391,7 +390,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
assert len(coord) == 0 assert len(coord) == 0
else: else:
assert len(coord) == len(glyph.coordinates) assert len(coord) == len(glyph.coordinates)
glyph.coordinates = coord glyph.coordinates = GlyphCoordinates(coord)
glyph.recalcBounds(self) glyph.recalcBounds(self)