class Column(pygame.sprite.DirtySprite) :
- def __init__(self, group, hue, rect, tone) :
+ def __init__(self, group, hue, rect, tone, atBorder) :
pygame.sprite.DirtySprite.__init__(self, group)
self.state = False
onLeft = rect.centerx - onWidth / 2
rectOn = pygame.Rect((onLeft, 0),
(onWidth, rect.height))
+ if atBorder :
+ setattr(rectOn, atBorder, getattr(rect, atBorder))
+
self.surOn = gradients.vertical(rectOn.size, topRgba, bottomRgba)
w, h = rectOn.w, rectOn.h
toneRect = pygame.Rect(((w - tw) / 2, h - th), (tw, th))
for i, rect in enumerate(self.keyboardRects) :
hue = FIRST_HUE - hueStep * i
tone = self.distinctNotes[i]
- c = Column(self, hue, rect, tone)
+ atBorder = False
+ if i == 0 :
+ atBorder = 'left'
+ elif i == self.keyboardLength -1 :
+ atBorder = 'right'
+ c = Column(self, hue, rect, tone, atBorder)
self.add(c, layer=BACKGROUND_LAYER)
self.columns[tone.midi] = c