
There is a class Geom::ViewBox recently added to the 2Geom tree (2geom/viewbox.h), I think it should be used in preference to a new base class. It doesn't feel completely right to have a common base class for every object that has a viewbox.
Regards, Krzysztof
2014-02-09 21:07 GMT+01:00 Johan Engelen <jbc.engelen@...2592...>:
On 9-2-2014 20:36, Johan Engelen wrote:
On 6-2-2014 15:44, Tavmjong Bah wrote:
Hi,
A heads-up...
While mucking about the code I noticed that the same basic code to handle viewBox and preserveAspectRatio appeared in multiple files (8 times?) having originally been pasted directly or copied with some changes. Overtime the code was tweaked here and there.
I have created a new base class to handle viewBox and preserveAspectRatio and modified sp-root, sp-symbol, sp-image, sp-pattern, and marker to use the new class, resulting in a reduction of over 400 lines of code (yeah!). In the process, I've fixed a number of issues with using percentage based x, y, width, and height values.
Great that you are working on this part! The new viewbox handling code needs some love.
I have only glanced at it. Comment: don't multiple inherit in this case (SPSymbol, possibly others). Just make viewBox a _member_ of SPSymbol.
Please let me know if you find any problems.
(fixed build on Mac, it's a 2Geom issue)
I understand it is mostly a copy-paste of code? The code certainly needs cleanup... :(
Did some simple clean-up just now.
- Johan
Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.cl... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel