[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygame] Problem with pygame.display.update
Running this program should fill the entire screen with red pixels, but it
does not update the bottom-most and right-most pixels:
#------------------------------------
import pygame
from pygame.locals import *
pygame.init()
surface = pygame.display.set_mode( (640,480) )
surface.fill( (255,0,0), (0,0,640,480) )
pygame.display.update( (0,0,640,480) )
while pygame.event.wait().type not in [QUIT,KEYDOWN,MOUSEBUTTONDOWN]:
pass
#------------------------------------
The problem seems to be in display.c.
Lines 682-683 should be changed to:
wide = screen->w;
high = screen->h;
Also, the first if statement in screencroprect function, line 618 should be
changed to:
if(r->x > w || r->y > h || (r->x + r->w) <= 0 || (r->y + r->h) <= 0)
Cheers,
Nat.
________________________________
Dr. Nathaniel Pryce
B13media Ltd.
40-41 Whiskin St, London, EC1R 0BP, UK
http://www.b13media.com
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org