index bfca242f6bc3faa366f7f0d83ec691dfeb90b5dc..f62b1b4b3ca86dda01ada1594837df78c0020ad5 100755 (executable)
'S':['S', 4, [float, float, float, float], ['x','y','x','y']],
'Q':['Q', 4, [float, float, float, float], ['x','y','x','y']],
'T':['T', 2, [float, float], ['x','y']],
- 'A':['A', 7, [float, float, float, int, int, float, float], [0,0,0,0,0,'x','y']],
+ 'A':['A', 7, [float, float, float, int, int, float, float], ['r','r','a',0,'s','x','y']],
'Z':['L', 0, [], []]
}
def parsePath(d):
#use last command's implicit next command
needParam = False
if lastCommand:
- if token.isupper():
- command = pathdefs[lastCommand.upper()][0]
+ if lastCommand.isupper():
+ command = pathdefs[lastCommand][0]
else:
command = pathdefs[lastCommand.upper()][0].lower()
else:
#current values become "last" values
if outputCommand == 'M':
subPathStart = tuple(params[0:2])
+ pen = subPathStart
if outputCommand == 'Z':
pen = subPathStart
else:
params[i] *= x
elif defs[3][i] == 'y':
params[i] *= y
+ elif defs[3][i] == 'r': # radius parameter
+ params[i] *= x
+ elif defs[3][i] == 's': # sweep-flag parameter
+ if x*y < 0:
+ params[i] = 1 - params[i]
+ elif defs[3][i] == 'a': # x-axis-rotation angle
+ if y < 0:
+ params[i] = - params[i]
def rotatePath(p, a, cx = 0, cy = 0):
if a == 0:
params[i] = (r * math.cos(theta)) + cx
params[i + 1] = (r * math.sin(theta)) + cy
+
+# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99