From f6ca219fa69085fbbf9feff7ab72c51e805bc9bb Mon Sep 17 00:00:00 2001 From: pin Date: Thu, 25 Mar 2010 10:12:50 +0000 Subject: [PATCH] =?utf8?q?Fen=C3=AAtre=20de=20jeu=20:=20agrandissement=20c?= =?utf8?q?omme=20il=20faut=20en=20bordure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@115 fe552daf-6dbe-4428-90eb-1537e0879342 --- src/app/widgets/column.py | 5 ++++- src/app/widgets/playingscreen.py | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/widgets/column.py b/src/app/widgets/column.py index 92f53ba..e55b935 100755 --- a/src/app/widgets/column.py +++ b/src/app/widgets/column.py @@ -24,7 +24,7 @@ from config import FONT_COLOR 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 @@ -51,6 +51,9 @@ class Column(pygame.sprite.DirtySprite) : 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)) diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py index 2fad9c2..2635373 100755 --- a/src/app/widgets/playingscreen.py +++ b/src/app/widgets/playingscreen.py @@ -76,7 +76,12 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : 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 -- 2.20.1