From 1ac6ec3f41560d1d9d5691b45d0ded64df9397ff Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Tue, 11 Feb 2014 14:02:48 +0000 Subject: [PATCH] JSLint svgcanvas (50% scanned) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2691 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index b0289166..b3870949 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -558,9 +558,9 @@ var getIntersectionList = this.getIntersectionList = function(rect) { if (resultList == null || typeof(resultList.item) != "function") { resultList = []; - + var rubberBBox; if (!rect) { - var rubberBBox = rubberBox.getBBox(); + rubberBBox = rubberBox.getBBox(); var o, bb = {}; @@ -570,7 +570,7 @@ var getIntersectionList = this.getIntersectionList = function(rect) { rubberBBox = bb; } else { - var rubberBBox = rect; + rubberBBox = rect; } var i = curBBoxes.length; while (i--) { @@ -1690,7 +1690,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) { } evt.preventDefault(); - + var tlist; switch (current_mode) { case "select": // we temporarily use a translate on the element(s) being dragged @@ -1714,7 +1714,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) { if (dx != 0 || dy != 0) { len = selectedElements.length; for (i = 0; i < len; ++i) { - var selected = selectedElements[i]; + selected = selectedElements[i]; if (selected == null) {break;} // if (i==0) { // var box = svgedit.utilities.getBBox(selected); @@ -1725,7 +1725,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) { // update the dummy transform in our transform list // to be a translate var xform = svgroot.createSVGTransform(); - var tlist = svgedit.transformlist.getTransformList(selected); + tlist = svgedit.transformlist.getTransformList(selected); // Note that if Webkit and there's no ID for this // element, the dummy transform may have gotten lost. // This results in unexpected behaviour @@ -1790,8 +1790,8 @@ var getMouseTarget = this.getMouseTarget = function(evt) { // we track the resize bounding box and translate/scale the selected element // while the mouse is down, when mouse goes up, we use this to recalculate // the shape's coordinates - var tlist = svgedit.transformlist.getTransformList(selected), - hasMatrix = svgedit.math.hasMatrixTransform(tlist); + tlist = svgedit.transformlist.getTransformList(selected); + var hasMatrix = svgedit.math.hasMatrixTransform(tlist); box = hasMatrix ? init_bbox : svgedit.utilities.getBBox(selected); var left = box.x, top = box.y, width = box.width, height = box.height; @@ -3588,7 +3588,7 @@ pathActions = canvas.pathActions = function() { opencloseSubPath: function() { var sel_pts = svgedit.path.path.selected_pts; // Only allow one selected node for now - if (sel_pts.length !== 1) return; + if (sel_pts.length !== 1) {return;} var elem = svgedit.path.path.elem; var list = elem.pathSegList; @@ -3605,12 +3605,13 @@ pathActions = canvas.pathActions = function() { if (this.type === 2 && i <= index) { start_item = this.item; } - if (i <= index) return true; + if (i <= index) {return true;} if (this.type === 2) { // Found M first, so open open_pt = i; return false; - } else if (this.type === 1) { + } + if (this.type === 1) { // Found Z first, so closed open_pt = false; return false; @@ -3656,10 +3657,10 @@ pathActions = canvas.pathActions = function() { return; } - var last_m, z_seg; + var i, last_m, z_seg; // Find this sub-path's closing point and remove - for (var i=0; i