fixtransforms branch: Text elements maintain stretches/translations in groups
git-svn-id: http://svg-edit.googlecode.com/svn/branches/fixtransforms@1061 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
4259f84e99
commit
0dc0ec0d41
|
@ -1373,9 +1373,12 @@ function BatchCommand(text) {
|
||||||
changes["height"] = scaleh(changes["height"]);
|
changes["height"] = scaleh(changes["height"]);
|
||||||
break;
|
break;
|
||||||
case "text":
|
case "text":
|
||||||
var pt1 = remap(changes["x"],changes["y"]);
|
// we just absorb all matrices into the element and don't do any remapping
|
||||||
changes["x"] = pt1.x;
|
var chlist = canvas.getTransformList(selected);
|
||||||
changes["y"] = pt1.y;
|
var mt = svgroot.createSVGTransform();
|
||||||
|
mt.setMatrix(matrixMultiply(transformListToTransform(chlist).matrix,m));
|
||||||
|
chlist.clear();
|
||||||
|
chlist.appendItem(mt);
|
||||||
break;
|
break;
|
||||||
case "polygon":
|
case "polygon":
|
||||||
case "polyline":
|
case "polyline":
|
||||||
|
@ -1514,7 +1517,7 @@ function BatchCommand(text) {
|
||||||
|
|
||||||
var tlist = canvas.getTransformList(selected);
|
var tlist = canvas.getTransformList(selected);
|
||||||
|
|
||||||
// remove any stray identity transforms
|
// remove any unnecessary transforms
|
||||||
if (tlist && tlist.numberOfItems > 0) {
|
if (tlist && tlist.numberOfItems > 0) {
|
||||||
var k = tlist.numberOfItems;
|
var k = tlist.numberOfItems;
|
||||||
while (k--) {
|
while (k--) {
|
||||||
|
@ -1522,11 +1525,13 @@ function BatchCommand(text) {
|
||||||
if (xform.type == 0) {
|
if (xform.type == 0) {
|
||||||
tlist.removeItem(k);
|
tlist.removeItem(k);
|
||||||
}
|
}
|
||||||
|
// remove identity matrices
|
||||||
else if (xform.type == 1) {
|
else if (xform.type == 1) {
|
||||||
if (isIdentity(xform.matrix)) {
|
if (isIdentity(xform.matrix)) {
|
||||||
tlist.removeItem(k);
|
tlist.removeItem(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// remove zero-degree rotations
|
||||||
else if (xform.type == 4) {
|
else if (xform.type == 4) {
|
||||||
if (xform.angle == 0) {
|
if (xform.angle == 0) {
|
||||||
tlist.removeItem(k);
|
tlist.removeItem(k);
|
||||||
|
@ -1874,9 +1879,10 @@ function BatchCommand(text) {
|
||||||
var extrat = matrixMultiply(m_inv, rnew_inv, rold, m);
|
var extrat = matrixMultiply(m_inv, rnew_inv, rold, m);
|
||||||
|
|
||||||
remapElement(selected,changes,extrat);
|
remapElement(selected,changes,extrat);
|
||||||
|
if (angle) {
|
||||||
tlist.insertItemBefore(rnew,0);
|
tlist.insertItemBefore(rnew,0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // a non-group
|
} // a non-group
|
||||||
|
|
||||||
// if the transform list has been emptied, remove it
|
// if the transform list has been emptied, remove it
|
||||||
|
|
Loading…
Reference in New Issue