diff --git a/editor/svg-editor.html b/editor/svg-editor.html index c91a4cd2..56a6defb 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -71,7 +71,9 @@ - + + angle: + diff --git a/editor/svg-editor.js b/editor/svg-editor.js index b97d84ab..a96f8a0b 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -251,9 +251,17 @@ function svg_edit_setup() { pos = $('#tools_ellipse_show').position(); $('#tools_ellipse').css({'left': pos.left+4, 'top': pos.top+70}); - function changeStrokeWidth(ctl) { + var changeRectRadius = function(ctl) { + svgCanvas.setRectRadius(ctl.value); + } + + var changeStrokeWidth = function(ctl) { svgCanvas.setStrokeWidth(ctl.value); } + + var changeRotationAngle = function(ctl) { + // TODO: change rotation angle + } $('#stroke_style').change(function(){ svgCanvas.setStrokeStyle(this.options[this.selectedIndex].value); @@ -275,10 +283,6 @@ function svg_edit_setup() { svgCanvas.setTextContent(this.value); }); - function changeRectRadius(ctl) { - svgCanvas.setRectRadius(ctl.value); - } - $('.attr_changer').change(function() { svgCanvas.changeSelectedAttribute(this.getAttribute("alt"), this.value); }); @@ -772,6 +776,7 @@ function svg_edit_setup() { $('#rect_radius').SpinButton({ min: 0, max: 1000, step: 1, callback: changeRectRadius }); $('#stroke_width').SpinButton({ min: 1, max: 99, step: 1, callback: changeStrokeWidth }); + $('#angle').SpinButton({ min: -359, max: 359, step: 1, callback: changeRotationAngle }); return svgCanvas; }; diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 5cf30faf..d4adaedc 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -6,6 +6,10 @@ if(!window.console) { } // this defines which elements and attributes that we support +// TODO: add elements to this +// TODO: add elements to this +// TODO: add elements to this +// TODO: add xmlns:xlink attr to element var svgWhiteList = { "circle": ["cx", "cy", "fill", "fill-opacity", "id", "stroke", "r", "stroke-opacity", "stroke-width", "stroke-dasharray", "transform"], "defs": [],