Fix Issue 473: WebKit browsers fixed for navigation, caused by r1368
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1376 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
5ce59294d1
commit
507e50767f
|
@ -1992,20 +1992,22 @@ function BatchCommand(text) {
|
||||||
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 a = gangle * Math.PI / 180;
|
||||||
if (gangle) {
|
if ( Math.abs(a) > (1.0e-10) ) {
|
||||||
for (var i = 0; i < tlist.numberOfItems; ++i) {
|
var s = Math.sin(a)/(1 - Math.cos(a));
|
||||||
var xform = tlist.getItem(i);
|
} else {
|
||||||
if (xform.type == 4) {
|
// FIXME: This blows up if the angle is exactly 0!
|
||||||
// extract old center through mystical arts
|
var s = 2/a;
|
||||||
var rm = xform.matrix;
|
}
|
||||||
var a = gangle * Math.PI / 180;
|
for (var i = 0; i < tlist.numberOfItems; ++i) {
|
||||||
// FIXME: This blows up if the angle is exactly 0 or 180 degrees!
|
var xform = tlist.getItem(i);
|
||||||
oldcenter.y = 0.5 * (Math.sin(a)*rm.e + (1-Math.cos(a))*rm.f) / (1 - Math.cos(a));
|
if (xform.type == 4) {
|
||||||
oldcenter.x = ((1 - Math.cos(a)) * oldcenter.y - rm.f) / Math.sin(a);
|
// extract old center through mystical arts
|
||||||
tlist.removeItem(i);
|
var rm = xform.matrix;
|
||||||
break;
|
oldcenter.y = (s*rm.e + rm.f)/2;
|
||||||
}
|
oldcenter.x = (rm.e - s*rm.f)/2;
|
||||||
|
tlist.removeItem(i);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2223,19 +2225,23 @@ function BatchCommand(text) {
|
||||||
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
|
||||||
angle = canvas.getRotationAngle(selected);
|
angle = canvas.getRotationAngle(selected);
|
||||||
if (angle) {
|
|
||||||
for (var i = 0; i < tlist.numberOfItems; ++i) {
|
var a = angle * Math.PI / 180;
|
||||||
var xform = tlist.getItem(i);
|
if ( Math.abs(a) > (1.0e-10) ) {
|
||||||
if (xform.type == 4) {
|
var s = Math.sin(a)/(1 - Math.cos(a));
|
||||||
// extract old center through mystical arts
|
} else {
|
||||||
var rm = xform.matrix;
|
// FIXME: This blows up if the angle is exactly 0!
|
||||||
var a = angle * Math.PI / 180;
|
var s = 2/a;
|
||||||
// FIXME: This blows up if the angle is exactly 0 or 180 degrees!
|
}
|
||||||
oldcenter.y = 0.5 * (Math.sin(a)*rm.e + (1-Math.cos(a))*rm.f) / (1 - Math.cos(a));
|
for (var i = 0; i < tlist.numberOfItems; ++i) {
|
||||||
oldcenter.x = ((1 - Math.cos(a)) * oldcenter.y - rm.f) / Math.sin(a);
|
var xform = tlist.getItem(i);
|
||||||
tlist.removeItem(i);
|
if (xform.type == 4) {
|
||||||
break;
|
// extract old center through mystical arts
|
||||||
}
|
var rm = xform.matrix;
|
||||||
|
oldcenter.y = (s*rm.e + rm.f)/2;
|
||||||
|
oldcenter.x = (rm.e - s*rm.f)/2;
|
||||||
|
tlist.removeItem(i);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2730,7 +2736,11 @@ function BatchCommand(text) {
|
||||||
mouse_target = mouse_target.correspondingUseElement;
|
mouse_target = mouse_target.correspondingUseElement;
|
||||||
|
|
||||||
// for foreign content, go up until we find the foreignObject
|
// for foreign content, go up until we find the foreignObject
|
||||||
if ($.inArray(mouse_target.namespaceURI, [mathns, htmlns]) != -1) {
|
// WebKit browsers set the mouse target to the svgcanvas div
|
||||||
|
if ($.inArray(mouse_target.namespaceURI, [mathns, htmlns]) != -1 &&
|
||||||
|
mouse_target.id != "svgcanvas")
|
||||||
|
{
|
||||||
|
console.log(mouse_target.id);
|
||||||
while (mouse_target.nodeName != "foreignObject") {
|
while (mouse_target.nodeName != "foreignObject") {
|
||||||
mouse_target = mouse_target.parentNode;
|
mouse_target = mouse_target.parentNode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue