From: pin Date: Thu, 25 Mar 2010 10:12:50 +0000 (+0000) Subject: FenĂȘtre de jeu : agrandissement comme il faut en bordure. X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/commitdiff_plain/f6ca219fa69085fbbf9feff7ab72c51e805bc9bb?ds=inline FenĂȘtre de jeu : agrandissement comme il faut en bordure. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@115 fe552daf-6dbe-4428-90eb-1537e0879342 --- 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