def paint_item(self, item: Item, cairo: CairoContext) -> None: cairo.save() try: cairo.transform(item.matrix_i2c.to_cairo()) selection = self.selection item.draw( DrawContext( cairo=cairo, selected=(item in selection.selected_items), focused=(item is selection.focused_item), hovered=(item is selection.hovered_item), )) finally: cairo.restore()
def draw(self, context): """ Draw vertical line - symbol of fork and join nodes. Join specification is also drawn above the item. """ Item.draw(self, context) DiagramItem.draw(self, context) cr = context.cairo cr.set_line_width(6) h1, h2 = self._handles cr.move_to(h1.pos.x, h1.pos.y) cr.line_to(h2.pos.x, h2.pos.y) cr.stroke()