From 60c266b7f823409b488f634749afa9fb2a235bed Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Mon, 8 Jun 2009 12:46:04 +0000 Subject: [PATCH] Fix to previous change so that the selected outline rect is not selectable git-svn-id: http://svg-edit.googlecode.com/svn/trunk@69 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 042797e1..7645ba7e 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -118,6 +118,8 @@ function SvgCanvas(c) // call this function with null to clear the selected element var selectElement = function(newSelected) { + if (selected == newSelected) return; + // remove selected outline from previously selected element if (selected != null && selectedOutline != null) { svgroot.removeChild(selectedOutline); @@ -127,8 +129,9 @@ function SvgCanvas(c) selected = newSelected; if (selected != null) { +try{ var bbox = selected.getBBox(); - +}catch(e) { alert(selected); } // ideally we should create this element once during init, then remove from the DOM // and re-append to end of documentElement. This will also allow us to do some // interesting things like animate the stroke-dashoffset using a SMIL child @@ -143,7 +146,9 @@ function SvgCanvas(c) "x": bbox.x-1, "y": bbox.y-1, "width": bbox.width+2, - "height": bbox.height+2 + "height": bbox.height+2, + // need to specify this style so that the selectedOutline is not selectable + "style": "pointer-events:none", } });