Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Draw an ellipse.
x      - center x
y      - center y
width  - width of ellipse  (in x direction when angle=0)
height - height of ellipse (in y direction when angle=0)
angle  - angle in radians to rotate, clockwise

        def path_ellipse (cr, x, y, width, height, angle=0):
    """
    Draw an ellipse.
    x      - center x
    y      - center y
    width  - width of ellipse  (in x direction when angle=0)
    height - height of ellipse (in y direction when angle=0)
    angle  - angle in radians to rotate, clockwise
    """
    cr.save()
    cr.translate (x, y)
    cr.rotate (angle)
    cr.scale (width / 2.0, height / 2.0)
    cr.move_to(1.0, 0.0)
    cr.arc (0.0, 0.0, 1.0, 0.0, 2.0 * pi)
    cr.restore()
        


src/g/a/gaphas-0.7.2/gaphas/examples.py   gaphas(Download)
from gaphas.solver import solvable, WEAK
import tool
from util import text_align, text_multiline, path_ellipse
 
class Box(Element):
    def draw(self, context):
        cr = context.cairo
        path_ellipse(cr, 0, 0, 2 * self.radius, 2 * self.radius)
        cr.stroke()
 

src/g/a/gaphas-HEAD/gaphas/examples.py   gaphas(Download)
from gaphas.solver import solvable, WEAK
import tool
from util import text_align, text_multiline, path_ellipse
 
class Box(Element):
    def draw(self, context):
        cr = context.cairo
        path_ellipse(cr, 0, 0, 2 * self.radius, 2 * self.radius)
        cr.stroke()