[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Pygame2 FRect bug
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Pygame2 FRect bug
- From: Evan Kroske <e.kroske@xxxxxxxxx>
- Date: Sun, 14 Mar 2010 16:34:11 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 14 Mar 2010 16:34:21 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=2P/4OcgVZ7Ya+NNSHhMLXIsqkH7O4wObDS5+7BdohuQ=; b=A2L0Kpt/UyZ4OjqkZpq1P3XTHuuMFnPYi/GoklcJA8+D4W3tHw0xEaNxO4BmOuoS1F /yOAuwW3rbnsjcs6/J64RsNZd3szzokkr2JP/cMe/azpcwkHDnuhu/8eMro5K5Fs5tMb L3w9L3s5yKEvl1ZiK5SdK4tXixSxCTD9UZr4I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LoNleC6kVIDSTuuZIDCHDj2hPCuNibI7idt/pqKfeimkqeLSrl6bRdNLyLxf9IZPL9 tdNjCRgSTNL5CpKybKapF9PuplizK1Ww+JzSLR4C8ICwLqX+MIFD80IpyqybZAVhJf6F zMKZPu4eia6RrL7BYFggw6A5pgKo4b4eo1bO8=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I was working on my rapid-development game framework when I stumbled
upon a highly suspicious behavior. It appears that an FRect's center
can't be assigned values lower than their original values. For
example, if you define a template rectangle orgRect = Rect(0, 0, 30,
30), create a new rectangle newRect = FRect(orgRect), and attempt to
set the center of newRect to values lower than (15, 15) (the center of
orgRect), newRect will remain at (0, 0) with its center at (15, 15).
Here's an example:
import pygame2
def startTest():
orgRect = pygame2.Rect(0, 0, 20, 20)
newRect = pygame2.FRect(orgRect)
newRect.center = (-10, -10)
print(newRect.center) # (10, 10)
print(newRect.topleft) # (0, 0)
newRect.topleft = (-10, -10)
print(newRect.center) # (0, 0)
print(newRect.topleft) # (-10, -10)
if __name__ == "__main__":
startTest()
--
Evan Kroske
http://welcome2obscurity.blogspot.com/
The personal blog of Evan Kroske,
novice software developer.