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
Environment:
Current behavior:
Segfault when changing a pixel in a PixelArray.
Expected behavior:
Target pixel is set to the requested color in the PixelArray, as per documentation.
Test code
import pygame test = pygame.Surface([800,800]) testBuf = pygame.PixelArray(test) testBuf[400][400] = [255,255,0]
Stack trace/error output/other error logs
$ python3.11 Python 3.11.7 (main, Jan 29 2024, 16:03:57) [GCC 13.2.1 20230801] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pygame pygame 2.4.0 (SDL 2.30.0, Python 3.11.7) Hello from the pygame community. https://www.pygame.org/contribute.html >>> test = pygame.Surface([800,800]) >>> testBuf = pygame.PixelArray(test) >>> testBuf[400][400] = [255,255,0] Segmentation fault (core dumped)
The text was updated successfully, but these errors were encountered:
See this: https://www.pygame.org/docs/ref/pixelarray.html
So you would want to do something like: testBuf[400, 400] = pygame.Color(255, 255, 0)
testBuf[400, 400] = pygame.Color(255, 255, 0)
Sorry, something went wrong.
This should probably be handled more gracefully than segfaulting, since this seems like a common mistake to make.
No branches or pull requests
Environment:
Current behavior:
Segfault when changing a pixel in a PixelArray.
Expected behavior:
Target pixel is set to the requested color in the PixelArray, as per documentation.
Test code
Stack trace/error output/other error logs
The text was updated successfully, but these errors were encountered: