
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