cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

Does your library support SVG manipulating? #73

Closed Nizarazo closed 4 years ago

Nizarazo commented 4 years ago

Meaning user can click on SVG object and it will respond such as rotating or moving ?

igagis commented 4 years ago

Nope, this is not supported. Only rendering of static images.

Nizarazo commented 4 years ago

Thank you for your response. Do you know C++ tool that can manipulate SVG? or a tool that can parse and render SVG?

igagis commented 4 years ago

There is a number of SVG document libraries out there, including my own svgdom, you can find it here on github. I cannot say anything about other libs, I have not played with them.

Nizarazo commented 4 years ago

Thank you for your response. Is it possible by using both your svgdom and svgren to click on SVG object and it will respond?meaning it will rotate or move? In other words I need to register the SVG object to respond for events such as mouse down or keydown?

igagis commented 4 years ago

in theory it is possible, but the implementation will not be trivial.

Nizarazo commented 4 years ago

Any examples available demonstrating how to do it by using your svgdom and svgren?

igagis commented 4 years ago

Unfortunately, there are no such examples. As I said, the implementation of that functionality will not be trivial, because this is not something which was kept in mind when the libraries were designed. In order to implement that one has to do own click detection by traversing the SVG DOM and then by modifying the SVG DOM accordingly react on the detected mouse click. I know that @JaimeIvanCervantes was doing something like this in his project, maybe he could describe how he achieved similar functionality and how much efforts it took.