shear/skew transformation errors

Friedrich W. H. Kossebau kossebau at kde.org
Thu Apr 5 17:32:34 BST 2012


Am Donnerstag, 5. April 2012, 15:45:42 schrieb Friedrich W. H. Kossebau:
> Hi,
> 
> tl;dr There are unclear differences in skew transform handling in ODF and
> SVG, at least loading SVG with skewX/Y is broken. Expert input needed.
> 
> 
> I got pointed to the fact that there are problems with loading SVG files
> with shearing transformations, e.g. seen with the coords-trans-03-t from
> the w3c SVG test suite, from
> 	http://dev.w3.org/SVG/profiles/1.1F2/test/svg/coords-trans-03-t.svg
> 
> But after a short look I am still a little puzzled and would like some
> assistance.
> For one the docs of QTransform::shear(...) are shitty because they do not
> tell what kind of real value they take. From all code examples I found it
> seems to be "tan(radian value of the angle)", as also is the value in the
> matrix. From the ODF and SVG specs I would have guessed the skewX/skewY
> attributes take the same values with the same semantics. But the SVG
> attribute values are handled with
> 	tan(DEG2RAD(params[0].toDouble())) 		(SvgUtil.cpp)
> and the ODF attribute values with
> 	tan(-params[0].toDouble())"				(KoShape.cpp)
> 
> So the ODF skew values are given in radian values, not degree values, and
> the spec text is wrong about that? And is the angle in ODF clockwise, while
> it is counter-clockwise in SVG (see the "-" for ODF)?
> 
> To complicate things more, the code for loading graphic styles does
> 	tan(params[0].toDouble())					(KoOdfGraphicStyle.cpp)
> (and also has an error for mixing up the parameters for skewY).
> 
> So what code is wrong, where is LO/OOo code ruling over the spec (and where
> to discuss to fix this, to decrease spoiling of the ODF spec)?

After looking more into this, it seems LO/OOo code is ruling over the spec, 
and Calligra ODF code is just following here. Filed this to LO bugzilla as
	https://bugs.freedesktop.org/show_bug.cgi?id=48342
perhaps someone might want to subscribe to that to join any discussion.

Someone might need to test OOo and file a bug for them as well, no OOo here.

For the SVG loading the code seems alright, but somewhere things are screwed 
up, could not find something on a short look, so filed as 
https://bugs.kde.org/show_bug.cgi?id=297544

For KoOdfGraphicStyle.cpp, well, perhaps I might find/create some test 
document for this to see how the code should be like, if noone else beats me 
to it.

Cheers
Friedrich



More information about the calligra-devel mailing list