parent
1a4807e929
commit
0c9dd318aa
|
@ -2941,6 +2941,7 @@ class Path(MutableSequence):
|
|||
if command is None:
|
||||
raise ValueError("Unallowed implicit command in %s, position %s" % (
|
||||
pathdef, len(pathdef.split()) - len(elements)))
|
||||
last_command = command # Used by S and T
|
||||
|
||||
if command == 'M':
|
||||
# Moveto command.
|
||||
|
|
|
@ -277,3 +277,11 @@ class TestParser(unittest.TestCase):
|
|||
path1 = parse_path("m 100 100 L 300 100 L 200 300 z", 50 + 50j)
|
||||
path2 = Path("m 100 100 L 300 100 L 200 300 z", 50 + 50j)
|
||||
self.assertEqual(path1, path2)
|
||||
|
||||
def test_issue_99(self):
|
||||
p = Path("M 100 250 S 200 200 200 250 300 300 300 250")
|
||||
self.assertEqual(p.d(useSandT=True), 'M 100.0,250.0 S 200.0,200.0 200.0,250.0 S 300.0,300.0 300.0,250.0')
|
||||
self.assertEqual(p.d(),
|
||||
'M 100.0,250.0 C 100.0,250.0 200.0,200.0 200.0,250.0 C 200.0,300.0 300.0,300.0 300.0,250.0')
|
||||
self.assertNotEqual(p.d(),
|
||||
'M 100.0,250.0 C 100.0,250.0 200.0,200.0 200.0,250.0 C 200.0,250.0 300.0,300.0 300.0,250.0')
|
||||
|
|
Loading…
Reference in New Issue