-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
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
Add bezier from gfxdraw
module to draw
module
#3009
base: main
Are you sure you want to change the base?
Conversation
This note is outdated. |
gfxdraw
to draw
+ bring the same support like every draw
functiongfxdraw
module to draw
module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, LGTM. Bezier works as expected under the draw module instead of gfxdraw in my testing. the tests all pass locally as well.
Test program:
import pygame
pygame.init()
sf = pygame.display.set_mode((640, 480))
font = pygame.font.Font(size=36)
points = []
STEPS = 3
print("Click on the screen to put points.")
while 1:
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
points.append(event.pos)
sf.fill((0, 0, 0))
for p in points:
pygame.draw.circle(sf, (255, 0, 0), p, 5)
if len(points) > 2:
pygame.draw.lines(sf, (255, 0, 0), False, points)
pygame.draw.bezier(sf, points, STEPS, (255, 255, 255))
test = f"Points: {len(points)}\nSteps: {STEPS}"
text_sf = font.render(test, True, (255, 255, 255))
sf.blit(text_sf, (10, 400))
pygame.display.update()
I would like to know your opinion about the |
My main feeling is that we should try and get this merged so we can shim & steadily get rid of However, if you think the That way in the future it will be much easier to remove or alter the step argument while still allowing us to handle it as it is right now and make a convenient gfxdraw shim for it. So, to be clear the function signature (in python) would be something like:
|
Hello, as part of #3005 plan, this PR moves
pygame.gfxdraw.bezier
topygame.draw.bezier
.