def parse_circle(e): x = float(get_attribute(e, "cx")) y = float(get_attribute(e, "cy")) r = float(get_attribute(e, "r")) p = Path() p.ellipse(x, y, r*2, r*2) p.close() return p
def parse_circle(e): x = float(get_attribute(e, "cx")) y = float(get_attribute(e, "cy")) r = float(get_attribute(e, "r")) p = Path() p.ellipse(x, y, r * 2, r * 2) p.close() return p
def parse_oval(e): x = float(get_attribute(e, "cx")) y = float(get_attribute(e, "cy")) w = float(get_attribute(e, "rx")) * 2 h = float(get_attribute(e, "ry")) * 2 p = Path() p.ellipse(x, y, w, h) p.close() return p
def parse_oval(e): x = float(get_attribute(e, "cx")) y = float(get_attribute(e, "cy")) w = float(get_attribute(e, "rx"))*2 h = float(get_attribute(e, "ry"))*2 p = Path() p.ellipse(x, y, w, h) p.close() return p
def parse_circle(e): cx = float(get_attribute(e, "cx")) cy = float(get_attribute(e, "cy")) r = float(get_attribute(e, "r")) if r < 0: print >> sys.stderr, "Error: invalid negative value for <circle> attribute r=\"%s\"" % r r = 0 p = Path() p.ellipse(cx, cy, r*2, r*2) p.close() return p
def parse_circle(e): cx = float(get_attribute(e, "cx")) cy = float(get_attribute(e, "cy")) r = float(get_attribute(e, "r")) if r < 0: print >> sys.stderr, "Error: invalid negative value for <circle> attribute r=\"%s\"" % r r = 0 p = Path() p.ellipse(cx, cy, r * 2, r * 2) p.close() return p
def parse_ellipse(e): cx = float(get_attribute(e, "cx")) cy = float(get_attribute(e, "cy")) rx = float(get_attribute(e, "rx")) ry = float(get_attribute(e, "ry")) if rx < 0: print >> sys.stderr, "Error: invalid negative value for <ellipse> attribute rx=\"%s\"" % rx rx = 0 if ry < 0: print >> sys.stderr, "Error: invalid negative value for <ellipse> attribute ry=\"%s\"" % ry ry = 0 p = Path() p.ellipse(cx, cy, rx * 2, ry * 2) p.close() return p
def ellipse(position, width, height): p = Path() p.ellipse(position.x, position.y, width, height) return p