Fixed issue 472 in a somewhat hacky way
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1572 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
19a8549a64
commit
63bde23fed
|
@ -1823,15 +1823,6 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// var setIcon = function(holder_sel, id) {
|
|
||||||
// var icon = $.getSvgIcon(id).clone();
|
|
||||||
// var holder = $(holder_sel);
|
|
||||||
// icon[0].setAttribute('width',holder.width());
|
|
||||||
// icon[0].setAttribute('height',holder.height());
|
|
||||||
// holder.empty().append(icon)
|
|
||||||
// .attr('data-curopt', holder_sel.replace('_show','')); // This sets the current mode
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Unfocus text input when workarea is mousedowned.
|
// Unfocus text input when workarea is mousedowned.
|
||||||
(function() {
|
(function() {
|
||||||
var inp;
|
var inp;
|
||||||
|
@ -2296,7 +2287,7 @@
|
||||||
var icon = $.getSvgIcon(icon_id).clone();
|
var icon = $.getSvgIcon(icon_id).clone();
|
||||||
$(elem).empty().append(icon);
|
$(elem).empty().append(icon);
|
||||||
var size = curPrefs.iconsize;
|
var size = curPrefs.iconsize;
|
||||||
if(size !== 'm') {
|
if(size && size !== 'm') {
|
||||||
var icon_sizes = { s:16, m:24, l:32, xl:48}, obj = {};
|
var icon_sizes = { s:16, m:24, l:32, xl:48}, obj = {};
|
||||||
obj[elem + ' .svg_icon'] = icon_sizes[size];
|
obj[elem + ' .svg_icon'] = icon_sizes[size];
|
||||||
$.resizeSvgIcons(obj);
|
$.resizeSvgIcons(obj);
|
||||||
|
|
|
@ -961,7 +961,6 @@ function BatchCommand(text) {
|
||||||
'</svg>').documentElement, true);
|
'</svg>').documentElement, true);
|
||||||
|
|
||||||
$(svgroot).appendTo(container);
|
$(svgroot).appendTo(container);
|
||||||
|
|
||||||
var opac_ani = document.createElementNS(svgns, 'animate');
|
var opac_ani = document.createElementNS(svgns, 'animate');
|
||||||
$(opac_ani).attr({
|
$(opac_ani).attr({
|
||||||
attributeName: 'opacity',
|
attributeName: 'opacity',
|
||||||
|
@ -1777,7 +1776,9 @@ function BatchCommand(text) {
|
||||||
|
|
||||||
var i = selectedElements.length;
|
var i = selectedElements.length;
|
||||||
while(i--) {
|
while(i--) {
|
||||||
var cmd = recalculateDimensions(selectedElements[i]);
|
var elem = selectedElements[i];
|
||||||
|
// if(canvas.getRotationAngle(elem) && !hasMatrixTransform(canvas.getTransformList(elem))) continue;
|
||||||
|
var cmd = recalculateDimensions(elem);
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
batchCmd.addSubCommand(cmd);
|
batchCmd.addSubCommand(cmd);
|
||||||
}
|
}
|
||||||
|
@ -2052,6 +2053,8 @@ function BatchCommand(text) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// End here if all it has is a rotation
|
||||||
|
if(tlist.numberOfItems == 1 && canvas.getRotationAngle(selected)) return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if this element had no transforms, we are done
|
// if this element had no transforms, we are done
|
||||||
|
@ -2132,6 +2135,7 @@ function BatchCommand(text) {
|
||||||
transformListToTransform(tlist).matrix),
|
transformListToTransform(tlist).matrix),
|
||||||
m = svgroot.createSVGMatrix();
|
m = svgroot.createSVGMatrix();
|
||||||
|
|
||||||
|
|
||||||
// temporarily strip off the rotate and save the old center
|
// temporarily strip off the rotate and save the old center
|
||||||
var gangle = canvas.getRotationAngle(selected);
|
var gangle = canvas.getRotationAngle(selected);
|
||||||
if (gangle) {
|
if (gangle) {
|
||||||
|
@ -2157,7 +2161,11 @@ function BatchCommand(text) {
|
||||||
var tx = 0, ty = 0,
|
var tx = 0, ty = 0,
|
||||||
operation = 0,
|
operation = 0,
|
||||||
N = tlist.numberOfItems;
|
N = tlist.numberOfItems;
|
||||||
|
|
||||||
|
if(N) {
|
||||||
|
var first_m = tlist.getItem(0).matrix;
|
||||||
|
}
|
||||||
|
|
||||||
// first, if it was a scale then the second-last transform will be it
|
// first, if it was a scale then the second-last transform will be it
|
||||||
if (N >= 3 && tlist.getItem(N-2).type == 3 &&
|
if (N >= 3 && tlist.getItem(N-2).type == 3 &&
|
||||||
tlist.getItem(N-3).type == 2 && tlist.getItem(N-1).type == 2)
|
tlist.getItem(N-3).type == 2 && tlist.getItem(N-1).type == 2)
|
||||||
|
@ -2359,6 +2367,11 @@ function BatchCommand(text) {
|
||||||
// if it was a translate, put back the rotate at the new center
|
// if it was a translate, put back the rotate at the new center
|
||||||
if (operation == 2) {
|
if (operation == 2) {
|
||||||
if (gangle) {
|
if (gangle) {
|
||||||
|
newcenter = {
|
||||||
|
x: oldcenter.x + first_m.e,
|
||||||
|
y: oldcenter.y + first_m.f
|
||||||
|
};
|
||||||
|
|
||||||
var newRot = svgroot.createSVGTransform();
|
var newRot = svgroot.createSVGTransform();
|
||||||
newRot.setRotate(gangle,newcenter.x,newcenter.y);
|
newRot.setRotate(gangle,newcenter.x,newcenter.y);
|
||||||
tlist.insertItemBefore(newRot, 0);
|
tlist.insertItemBefore(newRot, 0);
|
||||||
|
@ -2550,8 +2563,12 @@ function BatchCommand(text) {
|
||||||
// if it was a translate, put back the rotate at the new center
|
// if it was a translate, put back the rotate at the new center
|
||||||
if (operation == 2) {
|
if (operation == 2) {
|
||||||
if (angle) {
|
if (angle) {
|
||||||
|
newcenter = {
|
||||||
|
x: oldcenter.x + m.e,
|
||||||
|
y: oldcenter.y + m.f
|
||||||
|
};
|
||||||
var newRot = svgroot.createSVGTransform();
|
var newRot = svgroot.createSVGTransform();
|
||||||
newRot.setRotate(angle,newcenter.x,newcenter.y);
|
newRot.setRotate(angle, newcenter.x, newcenter.y);
|
||||||
tlist.insertItemBefore(newRot, 0);
|
tlist.insertItemBefore(newRot, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue