699 |
# Put everything together and write it to the file |
# Put everything together and write it to the file |
700 |
self.file.write('%s %s d="%s"/>\n' % (self.make_id(), |
self.file.write('%s %s d="%s"/>\n' % (self.make_id(), |
701 |
self.make_meta(), join(data, '') ) ) |
self.make_meta(), join(data, '') ) ) |
702 |
|
|
703 |
def DrawSpline(self, points, closed=0): |
def DrawSpline(self, points, closed=0): |
704 |
"""Draw a spline object. |
"""Draw a spline object. |
705 |
""" |
""" |
706 |
self.DrawPolygon(points, 0) |
self.write_indent('<path %s ' % (self.make_style(1,1,0))) |
707 |
print "TODO: DrawSpline(..)" |
datastr = "" |
708 |
return # TODO: Implement |
# we have four points: start, control, control, end |
709 |
|
datastr+=('M %s %s C' % (points[0].x, points[0].y)) |
710 |
|
for i in (1,2,3): |
711 |
|
datastr+=(' %s %s' % (points[i].x,points[i].y)) |
712 |
|
self.file.write('%s %s d="%s"/>\n' % (self.make_id(), |
713 |
|
self.make_meta(), datastr ) ) |
714 |
|
|
715 |
def BeginClipPath(self, id): |
def BeginClipPath(self, id): |
716 |
"""Build a clipping region to draw in.""" |
"""Build a clipping region to draw in.""" |
717 |
self.write_indent('<clipPath id="%s">\n' % id) |
self.write_indent('<clipPath id="%s">\n' % id) |
718 |
self.indent_level += 1 |
self.indent_level += 1 |
719 |
|
|
720 |
def EndClipPath(self): |
def EndClipPath(self): |
721 |
"""End a clip path.""" |
"""End a clip path.""" |
722 |
self.indent_level -= 1 |
self.indent_level -= 1 |