Repeating rounding errors with svg:viewBox, svg:d & friends

C. Boemann cbo at boemann.dk
Sun Jul 8 09:23:33 BST 2012


On Sunday 08 July 2012 00:29:28 Friedrich W. H. Kossebau wrote:
> Hi,
> 
> is anyone currently looking into improving graph data handling?
> 
> Because things are slightly screwed there IMHO.
> 
> E.g. I was trying to fix EnhancedPathShape::saveOdf(...), which is
> currently saving non-integer data for "svg:viewBox", by code like
> 
>         context.xmlWriter().addAttribute("svg:viewBox", QString("%1 %2 %3
> 
%4").arg(m_viewBox.x()).arg(m_viewBox.y()).arg(m_viewBox.width()).arg(m_vie
> wBox.height()));
> 
> with m_viewBox being a QRectF (uh :) , only integer data is allowed in
> "svg:viewBox", as you surely know).
> 
> When looking at KoPathShape as reference all the qRound there looked
> suspicious, so I tested if and how the data changes on a few roundtrips.
> And it does, see attached file. Not sure how grave those changes are, but
> I would feel better if the data stays exactly the same. Someone agrees?
> 
> I would give it a try to get there if noone else it already retwisting
> those codelines with a similar goal.
> 
> Cheers
> Friedrich
I think you are safe, so go ahead.



More information about the calligra-devel mailing list