Custom renderers
Hi @tdewolff,
thanks a lot for providing this well-written and useful library.
I am currently in the process of writing a custom renderer for a JSON-based vector format I developed and use in many projects. The internal renderers do most of their path rendering directly in path.go with access to the private backing array.
Is there a way to do this with similar efficiency via the public API? I've had a quick look at Scanner, but it does not appear to provide the same amount of command detail as is available internally.
A perhaps more modular renderer system would be useful for the next major version, where renderers are implemented externally and could be put into their own repositories (especially OpenGL, which has many dependencies).
Hey Benedikt, thanks for the kind words, I'm happy to hear that the library is proving useful to you!
I've added the Path.Data function to get the private d []float64 data field, however the Scanner interface actually allows you to fully retrieve all path data and is a cleaner approach. What does the scanner not allow you to get?
I've added the
Path.Datafunction to get the privated []float64data field
Thank you very much for the quick reply and the addition.
however the
Scannerinterface actually allows you to fully retrieve all path data and is a cleaner approach. What does the scanner not allow you to get?
You are right, I have no idea how I did not see the Scanner.Cmd() at first glance - perhaps it somehow got lost in my IDE autocomplete. It appears to be all there.
What I thought might be useful for the next major version would be to implement the existing renderers via the Scanner interface to avoid baking them into the Path struct.
That's a great idea, especially for the OpenGL renderer and maybe the Fyne and Gio renderers!