Preventing 'changed' events from happening when a new temporary element is added
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@45 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
4ec40a2226
commit
7e9dc51d82
|
@ -73,7 +73,7 @@ function SvgCanvas(doc)
|
||||||
assignAttributes(shape, data.attr);
|
assignAttributes(shape, data.attr);
|
||||||
cleanupElement(shape);
|
cleanupElement(shape);
|
||||||
svgdoc.documentElement.appendChild(shape);
|
svgdoc.documentElement.appendChild(shape);
|
||||||
call("changed",shape);
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
var svgToString = function(elem, indent) {
|
var svgToString = function(elem, indent) {
|
||||||
|
@ -352,7 +352,7 @@ function SvgCanvas(doc)
|
||||||
case "fhellipse":
|
case "fhellipse":
|
||||||
if ((freehand_max_x - freehand_min_x) > 0 &&
|
if ((freehand_max_x - freehand_min_x) > 0 &&
|
||||||
(freehand_max_y - freehand_min_y) > 0) {
|
(freehand_max_y - freehand_min_y) > 0) {
|
||||||
addSvgElementFromJson({
|
call("changed",addSvgElementFromJson({
|
||||||
"element": "ellipse",
|
"element": "ellipse",
|
||||||
"attr": {
|
"attr": {
|
||||||
"cx": (freehand_min_x + freehand_max_x) / 2,
|
"cx": (freehand_min_x + freehand_max_x) / 2,
|
||||||
|
@ -368,13 +368,13 @@ function SvgCanvas(doc)
|
||||||
"stroke-opacity": current_stroke_opacity,
|
"stroke-opacity": current_stroke_opacity,
|
||||||
"fill-opacity": current_fill_opacity
|
"fill-opacity": current_fill_opacity
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "fhrect":
|
case "fhrect":
|
||||||
if ((freehand_max_x - freehand_min_x) > 0 &&
|
if ((freehand_max_x - freehand_min_x) > 0 &&
|
||||||
(freehand_max_y - freehand_min_y) > 0) {
|
(freehand_max_y - freehand_min_y) > 0) {
|
||||||
addSvgElementFromJson({
|
call("changed",addSvgElementFromJson({
|
||||||
"element": "rect",
|
"element": "rect",
|
||||||
"attr": {
|
"attr": {
|
||||||
"x": freehand_min_x,
|
"x": freehand_min_x,
|
||||||
|
@ -390,7 +390,7 @@ function SvgCanvas(doc)
|
||||||
"stroke-opacity": current_stroke_opacity,
|
"stroke-opacity": current_stroke_opacity,
|
||||||
"fill-opacity": current_fill_opacity
|
"fill-opacity": current_fill_opacity
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue