justvanrossum / drawbot-skia

A cross-platform subset of the DrawBot drawing API, using Skia
Apache License 2.0
77 stars 8 forks source link

Implement PointPen behaviour for BezierPath() #9

Closed jenskutilek closed 4 years ago

jenskutilek commented 4 years ago

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 commented 4 years ago

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

justvanrossum commented 4 years ago

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 commented 4 years ago

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