On Sat, 2014-08-16 at 23:21 +0200, Diederik van Lierop wrote:
Hi people,
The past weeks I've been trying to fix some transformation center offset regressions, which were caused by the new unit/viewbox stuff. That should all work reasonably well again, but it remains a headache. IMHO this transformation center handling is broken by design, and judging by some comments in the code I'm not the only one to think so. It requires all kinds of special casing everywhere transformations are being applied, due to the transformation center being expressed in horizontal/vertical coordinates, relative to the center of the bounding box. Does anybody know why it was designed like this?
If there are no strong objections, then I'd propose to use absolute coordinates, and to apply transformations as if it were simply a point of a path. This would make code much cleaner. We will no longer need to call document->ensureUpToDate() to force an update of the bounding box everytime the center is requested or changed. It might also allow us to get rid of the weird behavior of the transformation center (which should rotate with the item in case an object is rotated!)
Not that I'm going to change this now, but I might get to this after the 0.91 release.
I haven't thought this through carefully but you should note that CSS Transforms Level 1[1] has a 'transform-origin' property which is defined in terms of the bounding box. This property is/will be supported by all major browsers.
Tav
[1] http://www.w3.org/TR/css-transforms-1/#transform-origin-property