예제 #1
0
파일: __init__.py 프로젝트: DimosN/nodebox
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
파일: __init__.py 프로젝트: DimosN/nodebox
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
예제 #5
0
파일: __init__.py 프로젝트: RyanHun/nodebox
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
예제 #6
0
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
예제 #7
0
파일: __init__.py 프로젝트: RyanHun/nodebox
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
예제 #8
0
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
예제 #9
0
def ellipse(position, width, height):
    p = Path()
    p.ellipse(position.x, position.y, width, height)
    return p
예제 #10
0
def ellipse(position, width, height):
    p = Path()
    p.ellipse(position.x, position.y, width, height)
    return p