fixtransforms branch: groups with skewed elements now resize/move properly

git-svn-id: http://svg-edit.googlecode.com/svn/branches/fixtransforms@1034 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-12-13 03:31:30 +00:00
parent 4ca4260fc9
commit f2c98ab46e
1 changed files with 15 additions and 6 deletions

View File

@ -11,10 +11,9 @@
/*
TODOs for TransformList:
* fix resizing of rotated elements
* when resizing a group and elements are rotated within, collapse matrices now that it works
* go through ungrouping again
* go through Selector.resize() and make sure groups account for rotated/skewed children
* go through Selector.resize() and rework so that they are always rectangular
* go through ungrouping again
*/
/*
TODOs for Localizing:
@ -1617,14 +1616,16 @@ function BatchCommand(text) {
var m = transformListToTransform(childTlist).matrix;
var angle = canvas.getRotationAngle(child);
if(angle) {
var em = matrixMultiply(tm, sm, tmn);
if(angle || hasMatrixTransform(childTlist)) {
var em = matrixMultiply(tm, sm, tmn, m);
// this does not appear to work, something wrong with my logic here
var e2t = svgroot.createSVGTransform();
e2t.setMatrix(em);
childTlist.insertItemBefore(e2t,0);
childTlist.clear();
childTlist.appendItem(e2t,0);
}
// if not rotated or skewed, push the [T][S][-T] down to the child
else {
// update the transform list with translate,scale,translate
@ -2001,6 +2002,14 @@ function BatchCommand(text) {
}
return svgroot.createSVGTransformFromMatrix(m);
};
var hasMatrixTransform = function(tlist) {
var num = tlist.numberOfItems;
while (num--) {
if (tlist.getItem(num).type == 1) return true;
}
return false;
}
// // Easy way to loop through transform list, but may not be worthwhile
// var eachXform = function(elem, callback) {