From 262b0da7e72f907efff976b6faa0d05654b0774a Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 28 Jan 2011 16:10:43 +0000 Subject: [PATCH] Undo work on Issue 336: Live Updates to Dimensions git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1944 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index a1fda549..de4a2ed8 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -711,7 +711,6 @@ if(!elem) return; multiselected = (elems.length >= 2 && elems[1] != null); - // Only updating fields for single elements for now if(!multiselected) { switch ( mode ) { @@ -721,9 +720,10 @@ $('#tool_reorient').toggleClass('disabled', ang == 0); break; - case "select": - updateCoords(elem); - break; + // TODO: Update values that change on move/resize, etc +// case "select": +// case "resize": +// break; } } svgCanvas.runExtensions("elementTransition", { @@ -1374,40 +1374,8 @@ } return new $.jGraduate.Paint(opts); }; - - // Updates coordinate data of given elements. Could use optimization! - var updateCoords = function(elem) { - var elname = elem.tagName; - var unit = curConfig.baseUnit !== 'px' ? curConfig.baseUnit : null; - var x, y; - - // Get BBox vals for g, polyline and path - if(['g', 'polyline', 'path'].indexOf(elname) >= 0) { - var bb = svgCanvas.getStrokedBBox([elem]); - if(bb) { - x = bb.x; - y = bb.y; - } - } else { - x = elem.getAttribute('x'); - y = elem.getAttribute('y'); - } - - // Transform point - var newPt = svgedit.math.transformPoint(x, y, svgCanvas.transformListToTransform(svgCanvas.getTransformList(elem)).matrix); - - x = newPt.x; - y = newPt.y; - - if(unit) { - x = svgCanvas.convertUnit(x); - y = svgCanvas.convertUnit(y); - } - $('#selected_x').val(x || 0); - $('#selected_y').val(y || 0); - } + - // updates the toolbar (colors, opacity, etc) based on the selected element // This function also updates the opacity and id elements that are in the context panel var updateToolbar = function() {