diff --git a/editor/svg-editor.html b/editor/svg-editor.html index be942243..95600fa0 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -210,9 +210,9 @@ Circle
- Image Text Poly + Image
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 7247adce..e2b358ed 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -176,7 +176,7 @@ function svg_edit_setup() { // update contextual tools here var panels = { rect: ['radius','x','y','width','height'], - image: ['x','y','width','height'], + image: ['x','y','width','height'], circle: ['cx','cy','r'], ellipse: ['cx','cy','rx','ry'], line: ['x1','y1','x2','y2'], @@ -216,13 +216,11 @@ function svg_edit_setup() { if (svgCanvas.addedNew) { $('#text').focus().select(); } - }else if(el_name == 'image') { - var xlinkNS="http://www.w3.org/1999/xlink"; - $('#image_url').val(elem.getAttributeNS(xlinkNS, "href")); - - } - - + } + else if(el_name == 'image') { + var xlinkNS="http://www.w3.org/1999/xlink"; + $('#image_url').val(elem.getAttributeNS(xlinkNS, "href")); + } } } // if (elem != null) else if (multiselected) { @@ -642,7 +640,7 @@ function svg_edit_setup() { $('#tool_circle').mouseup(clickCircle); $('#tool_ellipse').mouseup(clickEllipse); $('#tool_fhellipse').mouseup(clickFHEllipse); - $('#tool_image').mouseup(clickImage); + $('#tool_image').mouseup(clickImage); $('#tool_text').click(clickText); $('#tool_poly').click(clickPoly); $('#tool_clear').click(clickClear); @@ -723,6 +721,7 @@ function svg_edit_setup() { ['5', clickEllipse], ['6', clickText], ['7', clickPoly], + ['8', clickImage], [modKey+'N', function(evt){clickClear();evt.preventDefault();}], [modKey+'S', function(evt){editingsource?saveSourceEditor():clickSave();evt.preventDefault();}], [modKey+'O', function(evt){clickOpen();evt.preventDefault();}], diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 36e94185..518247ad 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -13,7 +13,7 @@ var svgWhiteList = { "circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"], "defs": [], "ellipse": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"], - "image": ["height", "id", "opacity", "transform" "width", "x", "xlink:href", "xlink:title", "y"], + "image": ["height", "id", "opacity", "transform", "width", "x", "xlink:href", "xlink:title", "y"], "line": ["fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-opacity", "stroke-width", "transform", "x1", "x2", "y1", "y2"], "linearGradient": ["id", "gradientTransform", "gradientUnits", "spreadMethod", "x1", "x2", "y1", "y2"], "path": ["d", "fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform"], @@ -2447,6 +2447,7 @@ function BatchCommand(text) { }; this.setFillColor = function(val,preventUndo) { + console.log('setFillColor(' + val + ')'); cur_properties.fill = val; cur_properties.fill_paint = {type:"solidColor"}; // take out any path/line elements when setting fill