From 7e9dc51d8245a24b0feb841152fa0970d12f37f6 Mon Sep 17 00:00:00 2001 From: Vidar Hokstad Date: Sat, 6 Jun 2009 18:37:43 +0000 Subject: [PATCH] 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-75d572ba1ddd --- editor/svgcanvas.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 06ddc245..b9ea3fc8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -73,7 +73,7 @@ function SvgCanvas(doc) assignAttributes(shape, data.attr); cleanupElement(shape); svgdoc.documentElement.appendChild(shape); - call("changed",shape); + return shape; } var svgToString = function(elem, indent) { @@ -352,7 +352,7 @@ function SvgCanvas(doc) case "fhellipse": if ((freehand_max_x - freehand_min_x) > 0 && (freehand_max_y - freehand_min_y) > 0) { - addSvgElementFromJson({ + call("changed",addSvgElementFromJson({ "element": "ellipse", "attr": { "cx": (freehand_min_x + freehand_max_x) / 2, @@ -368,13 +368,13 @@ function SvgCanvas(doc) "stroke-opacity": current_stroke_opacity, "fill-opacity": current_fill_opacity } - }); + })); } break; case "fhrect": if ((freehand_max_x - freehand_min_x) > 0 && (freehand_max_y - freehand_min_y) > 0) { - addSvgElementFromJson({ + call("changed",addSvgElementFromJson({ "element": "rect", "attr": { "x": freehand_min_x, @@ -390,7 +390,7 @@ function SvgCanvas(doc) "stroke-opacity": current_stroke_opacity, "fill-opacity": current_fill_opacity } - }); + })); } break; }