[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] BUG: problem with surface clipping region
- To: pygame-users@xxxxxxxx
- Subject: [pygame] BUG: problem with surface clipping region
- From: "Diego Essaya" <dessaya@xxxxxxxxx>
- Date: Mon, 12 Mar 2007 20:54:48 -0300
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 12 Mar 2007 19:54:59 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=Gd3rk5PBn364gSxDzCbbFxHgfo2+WRf10XdFlwW52lou9TYhnAuI5a7t/8aBIOZDMSq7yNzCe1zfIvixKRmSgBUw/D/U5Eb2gbhYdHiYO8lh7m3T6bop3U/s4D5afLB7GIt9pdNdkzZ3AHyyXYT0z6elxwMZgzvyomYW6UZSkPU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=GXNDGAJS33TH08W1WbKQMWkE5NVjsrBSpF5dkQoPF8mHCV0mhPmRrDhDyT3t/qFymUnJmggpgjkMeYquegDq4veSaqjAk/Ennyarn31A4+2IcOfob0f+PdY+uSVynlceEH0Mw1/bhM0tQna6ZDqNTzbUYm8yDtYCXvLKf3cxbJk=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I'm having this problem with the Surface.set_clip() method that appears to be a bug:
import pygame
print pygame.__version__
s = pygame.display.set_mode((800, 600))
r = pygame.Rect(10, 10, 10, 10)
s.set_clip(r)
print s.get_clip()
r.move_ip(10, 0)
print s.get_clip()
s.set_clip(None)
print s.get_clip()
This yields the following output:
1.7.1release
<rect(10, 10, 10, 10)>
<rect(10, 10, 10, 10)>
<rect(25708, 0, 0, 600)>
After this, the clip region of the display surface is garbled and operations on the surface fail. Running the script again yields a different garbled value.
I tried modifying the line with set_clip() with:
s.set_clip(pygame.Rect(r))
but this did not solve the problem.
Is this really a bug, or am I doing something wrong? Also, my apologies if this has been discussed before.
Thanks,
Diego