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
master
Jeff Schiller 2009-08-14 22:50:34 +00:00
parent 28020bc2e2
commit 93611c6c71
3 changed files with 17 additions and 6 deletions

View File

@ -71,7 +71,9 @@
<option value="0.3">30 %</option>
<option value="0.2">20 %</option>
<option value="0.1">10 %</option>
</select>
</select>
<span class="selected_tool">angle:</span>
<input id="angle" class="selected_tool" title="Change rotation angle" alt="Rotation Angle" size="2" value="0" type="text"/>
</div>
<!-- Buttons when something a single element is selected -->

View File

@ -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;
};

View File

@ -6,6 +6,10 @@ if(!window.console) {
}
// this defines which elements and attributes that we support
// TODO: add <g> elements to this
// TODO: add <polygon> elements to this
// TODO: add <a> elements to this
// TODO: add xmlns:xlink attr to <svg> element
var svgWhiteList = {
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "stroke", "r", "stroke-opacity", "stroke-width", "stroke-dasharray", "transform"],
"defs": [],