From 93611c6c712bb4e323f566377ff5f7f6a5e40eb0 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 14 Aug 2009 22:50:34 +0000 Subject: [PATCH] Add angle spinner to select panel - does nothing yet git-svn-id: http://svg-edit.googlecode.com/svn/trunk@383 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.html | 4 +++- editor/svg-editor.js | 15 ++++++++++----- editor/svgcanvas.js | 4 ++++ 3 files changed, 17 insertions(+), 6 deletions(-) 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": [],