Fixed issue 575 and issue 577 on trunk

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1599 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-06-16 13:16:00 +00:00
parent 58639c2ea2
commit e953bd9c78
2 changed files with 19 additions and 9 deletions

View File

@ -406,7 +406,18 @@ svgEditor.addExtension("Connector", function(S) {
if(svgCanvas.getMode() == "connector") {
var fo = $(mouse_target).closest("foreignObject");
if(fo.length) mouse_target = fo[0];
if(mouse_target.parentNode.parentNode != svgcontent) {
var parents = $(mouse_target).parents();
if(mouse_target == start_elem) {
// Start line through click
started = true;
return {
keep: true,
element: null,
started: started
}
} else if($.inArray(svgcontent, parents) === -1) {
// Not a valid target element, so remove line
$(cur_line).remove();
started = false;
@ -415,14 +426,6 @@ svgEditor.addExtension("Connector", function(S) {
element: null,
started: started
}
} else if(mouse_target == start_elem) {
// Start line through click
started = true;
return {
keep: true,
element: null,
started: started
}
} else {
// Valid end element
end_elem = mouse_target;

View File

@ -279,6 +279,12 @@ function ChangeElementCommand(elem, attrs, text) {
if (this.elem.tagName == "title" && this.elem.parentNode.parentNode == svgcontent) {
identifyLayers();
}
// Remove transformlist to prevent confusion that causes bugs like 575.
if (svgTransformLists[this.elem.id]) {
delete svgTransformLists[this.elem.id];
}
return true;
};
@ -5663,6 +5669,7 @@ function BatchCommand(text) {
batchCmd.addSubCommand(new ChangeElementCommand(elem, changes));
canvas.clearSelection();
this.resetOrientation(elem);
addCommandToHistory(batchCmd);
// Set matrix to null