diff options
Diffstat (limited to 'staff.py')
-rw-r--r-- | staff.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -25,21 +25,22 @@ class Staff: rmarg = 0 spacing = 0 ymax = 0 + clef = None def __init__(self): pass - def draw(self, context, width, margin=None): + def draw(self, window, width): + context = window.cairo_create() context.set_source_rgb(0, 0, 0) context.set_line_width(2) line_y = self.y + self.spacing * 2 for i in range(5): - if margin != None: - x = margin - else: - x = self.lmarg + x = self.lmarg context.move_to(x, line_y) context.line_to(width - self.rmarg, line_y) line_y += self.spacing self.ymax = line_y + self.spacing * 2 context.stroke() + self.clef.draw(window.cairo_create(), self.lmarg * 1.1, self.y, + self.lmarg * 0.3, self.ymax - self.y - self.spacing) |