fill(): negative coordinates

Issue #123 resolved
Anonymous created an issue

with python3, Surface.fill() converts negative coordinates to zero, thus the boxes drawn on the outside (top left) are clipped to the inside of the screen.

Comments (9)

  1. René Dudfield

    A rectangle outside of the screen completely Call Should not Be Filled inside of the screen, right?

    with python2, Surface.fill (color, Rect (-30, -30,20,20)) draws nothing and return Rect (0,0,0,0) what is right.

    with python3, Surface.fill (color, Rect (-30, -30,20,20)) return Rect (0,0,20,20) and fills in these coordinates.

  2. Lukas Diekmann

    Is this intended behaviour? I'm having a similar problem with python2, where a rectangle that should be drawn half outside the surface area, is moved completely inside the area.

    For example: surface.fill(bgcolor, (-10,-10, 100, 100)) will be drawn at (0,0,100,100).

    I solved this by reverting back to pygame.draw.rect which can draw rectangles partly off screen, but was wondering if this is intended.

  3. Log in to comment