[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG: problem with surface clipping region



Hi,

this bug has been fixed.

Cheers,

Committed revision 992.


On 3/13/07, Diego Essaya <dessaya@xxxxxxxxx> wrote:
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