SVGPathElement.prototype.mtx2attrs = function(mtx) {
var seg,letter,point,pt={},
angle = Math.atan2(mtx.b, mtx.a),
svg = this.ownerSVGElement,
list = this.pathSegList,
i=0, N = list.numberOfItems;
/* this.rel2abs(); function that change relative paths to absolute
*/
for (;i<N;i++) {
seg = list.getItem(i);
letter = seg.pathSegTypeAsLetter;
['','1','2'].forEach(function(ind) {
if (seg['x'+ind] === undefined && seg['y'+ind] ===
undefined) { return; }
if (seg['x'+ind] !== undefined) { pt['x'+ind] =
seg['x'+ind]; }
if (seg['y'+ind] !== undefined) { pt['y'+ind] =
seg['y'+ind]; }
var point = svg.createSVGPoint();
point.x = pt['x'+ind]; point.y = pt['y'+ind];
point = point.matrixTransform(mtx);
seg['x'+ind] = point.x;
seg['y'+ind] = point.y;
});
if (angle!==0 && (letter === 'H' || letter === 'V')) {
this.pathSegList.replaceItem( this.createSVGPathSegLinetoAbs(seg.x,seg.y) ,
i );
}
else if (letter === 'A') {
/*what to do in that case ??
seg.r1 = ?
seg.r2 = ?
seg.angle+= angle ?
*/
}
}
};
https://bugzilla.mozilla.org/show_bug.cgi?id=446654 has been around
for 3 years and nobody has stepped up to implement it. Why don't you?
Patches are always welcome.
Best regards
Robert.