Skip to content
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

Implement PointPen behaviour for BezierPath() #9

Merged
merged 4 commits into from
Oct 13, 2020

Conversation

jenskutilek
Copy link
Contributor

@jenskutilek jenskutilek commented Oct 9, 2020

Per the DrawBot docs, a BezierPath can be used like a PointPen. I tried to implement it and it seems to work, but I'm not sure that's all there's to it ;)

@justvanrossum
Copy link
Owner

Hm, I don't like the multiple inheritance and I don't like the circular reference that never gets broken. Let me think.

@justvanrossum
Copy link
Owner

Have a look at what DB does:

https://github.com/typemytype/drawbot/blob/f96bb7fb26ec2163fa5400ee2c38676b7af6f6bb/drawBot/context/baseContext.py#L221-L227

It uses a temporary PointToSegmentPen that gets removed at endPath().

@jenskutilek
Copy link
Contributor Author

Of course! I should have checked the drawBot code in the first place.

Copy link
Owner

@justvanrossum justvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Apart from one nit, this looks good.

src/drawbot_skia/path.py Outdated Show resolved Hide resolved
Co-authored-by: Just van Rossum <[email protected]>
@justvanrossum justvanrossum merged commit 3e03c44 into justvanrossum:master Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants