Example #1
0
    def arc_to(self, x1, y1, x2, y2, r):
        # get the current pen position
        current_point = self.get_current_point()

        # Get the two points on the curve where it touches the line segments
        t1, t2 = arc_to_tangent_points(current_point, (x1,y1), (x2,y2), r)

        # draw!
        self.path.lineTo(*t1)
        self.path.quadTo(x1,y1,*t2)
        self.path.lineTo(x2,y2)
Example #2
0
File: pdf.py Project: wilsaj/enable
    def arc_to(self, x1, y1, x2, y2, radius):
        """
        """
        if self.current_pdf_path is None:
            self.begin_path()

        # Get the endpoints on the curve where it touches the line segments
        t1, t2 = arc_to_tangent_points(self.current_point,
                                       (x1, y1), (x2, y2), radius)

        # draw!
        self.current_pdf_path.lineTo(*t1)
        self.current_pdf_path.curveTo(x1, y1, x1, y1, *t2)
        self.current_pdf_path.lineTo(x2, y2)
        self.current_point = (x2, y2)