We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code gives some examples of incorrect bounding rects returned from pygame.draw.aalines.
pygame.draw.aalines
import pygame WIDTH, HEIGHT = 320, 320 screen = pygame.display.set_mode((WIDTH, HEIGHT)) color = pygame.Color('red') # Drawing fully on the surface gives an incorrect bounds. pts = ((0, 0), (WIDTH - 1, HEIGHT - 1)) bounds = pygame.draw.aalines(screen, color, 1, pts, 1) print('bounds={}, expecting <rect(0, 0, 320, 320)>'.format(bounds)) # Drawing partially off the surface gives an incorrect bounds. pts = ((-1, -1), (WIDTH - 1, HEIGHT - 1)) bounds = pygame.draw.aalines(screen, color, 1, pts, 1) print('bounds={}, expecting <rect(0, 0, 320, 320)>'.format(bounds)) # Drawing fully off the surface gives an incorrect bounds. pts = ((WIDTH + 1, HEIGHT + 1), (WIDTH + 5, HEIGHT + 5)) bounds = pygame.draw.aalines(screen, color, 1, pts, 1) print('bounds={}, expecting <rect(321, 321, 0, 0)>'.format(bounds))
The above code gives the following output. The returned bounding rects are not as expected.
pygame 2.0.0.dev2 (SDL 2.0.9, python 3.7.2) Hello from the pygame community. https://www.pygame.org/contribute.html bounds=<rect(0, 0, 321, 321)>, expecting <rect(0, 0, 320, 320)> bounds=<rect(-1, -1, 322, 322)>, expecting <rect(0, 0, 320, 320)> bounds=<rect(321, 321, 6, 6)>, expecting <rect(321, 321, 0, 0)>
System details:
The text was updated successfully, but these errors were encountered:
Test added with @unittest.expectedFailure decorator via #1170.
@unittest.expectedFailure
Sorry, something went wrong.
Resolved by #1494.
No branches or pull requests
The following code gives some examples of incorrect bounding rects returned from
pygame.draw.aalines
.The above code gives the following output. The returned bounding rects are not as expected.
System details:
The text was updated successfully, but these errors were encountered: