How to use the gaphas.util.path_ellipse function in gaphas

To help you get started, we’ve selected a few gaphas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaphor / gaphor / gaphor / diagram / usecases / usecase.py View on Github external
def draw_usecase(box, context, bounding_box):
    cr = context.cairo

    rx = bounding_box.width / 2.0
    ry = bounding_box.height / 2.0

    cr.move_to(bounding_box.width, ry)
    path_ellipse(cr, rx, ry, bounding_box.width, bounding_box.height)
    cr.stroke()
github gaphor / gaphor / gaphor / diagram / states / pseudostates.py View on Github external
def draw_initial_pseudostate(box, context, bounding_box):
    """
    Draw intial pseudostate symbol.
    """
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
github gaphor / gaphor / gaphor / diagram / actions / activitynodes.py View on Github external
def draw_flow_final_node(_box, context, _bounding_box):
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.stroke()

    dr = (1 - math.sin(math.pi / 4)) * r
    cr.move_to(dr, dr)
    cr.line_to(d - dr, d - dr)
    cr.move_to(dr, d - dr)
    cr.line_to(d - dr, dr)
    cr.stroke()
github gaphor / gaphor / gaphor / diagram / states / pseudostates.py View on Github external
def draw_history_pseudostate(box, context, bounding_box):
    cr = context.cairo
    r = 15
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    # cr.set_line_width(1)
    cr.move_to(12, 10)
    cr.line_to(12, 20)
    cr.move_to(18, 10)
    cr.line_to(18, 20)
    cr.move_to(12, 15)
    cr.line_to(18, 15)
    cr.stroke()
github gaphor / gaphor / gaphor / diagram / states / finalstate.py View on Github external
def draw_final_state(box, context, bounding_box):
    cr = context.cairo
    r = 16
    d = 20
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    cr.stroke()
github gaphor / gaphor / gaphor / diagram / actions / activitynodes.py View on Github external
def draw_initial_node(_box, context, _bounding_box):
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
github gaphor / gaphor / gaphor / diagram / general / simpleitem.py View on Github external
def draw(self, context):
        cr = context.cairo
        nw = self._handles[NW]
        style = self.style

        rx = self.width / 2.0
        ry = self.height / 2.0

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        # cr.set_source_rgba(*style.fill_color)
        # cr.fill_preserve()
        cr.set_source_rgba(*style("color"))
        cr.set_line_width(style("line-width"))
        cr.stroke()
github gaphor / gaphor / gaphor / diagram / states / finalstate.py View on Github external
def draw_final_state(box, context, bounding_box):
    cr = context.cairo
    r = 16
    d = 20
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    cr.stroke()
github gaphor / gaphor / gaphor / diagram / actions / activitynodes.py View on Github external
def draw_activity_final_node(_box, context, _bounding_box):
    cr = context.cairo
    inner_radius = 10
    outer_radius = 15

    r = outer_radius + 1
    d = inner_radius * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    cr.stroke()