예제 #1
0
파일: svg.py 프로젝트: theoden-dd/outwiker
    def path(self, pd, **kwargs):
        fill = kwargs.get('fill')
        outline = kwargs.get('outline')

        p = path(pd, fill=rgb(fill), stroke=rgb(outline),
                 **drawing_params(kwargs))
        self.svg.addElement(p)
예제 #2
0
파일: svg.py 프로젝트: theoden-dd/outwiker
    def arc(self, box, start, end, **kwargs):
        fill = kwargs.get('fill')

        w = box.width / 2
        h = box.height / 2

        if start > end:
            end += 360

        endpoints = ellipse_endpoints(1, w, h, start, end)
        pt1 = XY(box.x + w + round(endpoints[0].x, 0),
                 box.y + h + round(endpoints[0].y, 0))
        pt2 = XY(box.x + w + round(endpoints[1].x, 0),
                 box.y + h + round(endpoints[1].y, 0))

        if end - start > 180:
            largearc = 1
        else:
            largearc = 0

        pd = pathdata(pt1[0], pt1[1])
        pd.ellarc(w, h, 0, largearc, 1, pt2[0], pt2[1])
        p = path(pd, fill="none", stroke=rgb(fill),
                 **drawing_params(kwargs))
        self.svg.addElement(p)
예제 #3
0
파일: svg.py 프로젝트: sunlynx/blockdiag
    def path(self, pd, **kwargs):
        fill = kwargs.get('fill')
        outline = kwargs.get('outline')

        p = path(pd,
                 fill=rgb(fill),
                 stroke=rgb(outline),
                 **drawing_params(kwargs))
        self.svg.addElement(p)
예제 #4
0
파일: svg.py 프로젝트: chiamingyen/kmol2016
    def line(self, points, **kwargs):
        fill = kwargs.get("fill")
        thick = kwargs.get("thick")

        pd = pathdata(points[0].x, points[0].y)
        for pt in points[1:]:
            pd.line(pt.x, pt.y)

        p = path(pd, fill="none", stroke=rgb(fill), stroke_width=thick, **drawing_params(kwargs))
        self.svg.addElement(p)
예제 #5
0
파일: svg.py 프로젝트: sunlynx/blockdiag
    def line(self, points, **kwargs):
        fill = kwargs.get('fill')
        thick = kwargs.get('thick')

        pd = pathdata(points[0].x, points[0].y)
        for pt in points[1:]:
            pd.line(pt.x, pt.y)

        p = path(pd,
                 fill="none",
                 stroke=rgb(fill),
                 stroke_width=thick,
                 **drawing_params(kwargs))
        self.svg.addElement(p)
예제 #6
0
파일: svg.py 프로젝트: sunlynx/blockdiag
    def arc(self, box, start, end, **kwargs):
        fill = kwargs.get('fill')

        w = box.width / 2
        h = box.height / 2

        if start > end:
            end += 360

        endpoints = ellipse_endpoints(1, w, h, start, end)
        pt1 = XY(box.x + w + round(endpoints[0].x, 0),
                 box.y + h + round(endpoints[0].y, 0))
        pt2 = XY(box.x + w + round(endpoints[1].x, 0),
                 box.y + h + round(endpoints[1].y, 0))

        if end - start > 180:
            largearc = 1
        else:
            largearc = 0

        pd = pathdata(pt1[0], pt1[1])
        pd.ellarc(w, h, 0, largearc, 1, pt2[0], pt2[1])
        p = path(pd, fill="none", stroke=rgb(fill), **drawing_params(kwargs))
        self.svg.addElement(p)