From 96f74b4daeeef2fb2f6e7ca3807496aabb78110a Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Wed, 24 Jun 2009 04:17:35 +0000 Subject: [PATCH] Add circle, ellipse, line context controls git-svn-id: http://svg-edit.googlecode.com/svn/trunk@187 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.css | 24 +++++++++++++++++++++ editor/svg-editor.html | 47 +++++++++++++++++++++++++++++++++++------- editor/svg-editor.js | 25 +++++++++++++++++++++- wave/svg-edit.xml | 43 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 128 insertions(+), 11 deletions(-) diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 28e5896a..13fc7955 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -102,6 +102,18 @@ display: none; } +#svg_editor #circle_panel { + display: none; +} + +#svg_editor #ellipse_panel { + display: none; +} + +#svg_editor #line_panel { + display: none; +} + #svg_editor #text_panel { display: none; } @@ -114,6 +126,18 @@ vertical-align:12px; } +#svg_editor #circle_panel .circle_tool { + vertical-align:12px; +} + +#svg_editor #ellipse_panel .ellipse_tool { + vertical-align:12px; +} + +#svg_editor #line_panel .line_tool { + vertical-align:12px; +} + #svg_editor .tool_button, #svg_editor .tool_button_current, #svg_editor .tool_button_disabled { height: 24px; width: 24px; diff --git a/editor/svg-editor.html b/editor/svg-editor.html index e9b2dda3..ed645aaa 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -43,7 +43,6 @@ Bottom -
| @@ -59,17 +58,49 @@ - - - - - + + + + + - +
- +
+ | + + + + + + +
+ +
+ | + + + + + + + + +
+ +
+ | + + + + + + + + +
| diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 09fa1cf8..7cc20221 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -80,19 +80,42 @@ function svg_edit_setup() { var elem = selectedElement; $('#selected_panel').hide(); $('#rect_panel').hide(); + $('#circle_panel').hide(); + $('#ellipse_panel').hide(); + $('#line_panel').hide(); $('#text_panel').hide(); if (elem != null) { $('#selected_panel').show(); // update contextual tools here switch(elem.tagName) { case "rect": - $('#rect_panel').show().css("display", "inline"); + $('#rect_panel').show(); $('#rect_radius').val(elem.getAttribute("rx")||0); $('#rect_x').val(elem.getAttribute("x")||0); $('#rect_y').val(elem.getAttribute("y")||0); $('#rect_w').val(elem.getAttribute("width")||0); $('#rect_h').val(elem.getAttribute("height")||0); break; + case "circle": + $('#circle_panel').show(); + $('#circle_cx').val(elem.getAttribute("cx")||0); + $('#circle_cy').val(elem.getAttribute("cy")||0); + $('#circle_r').val(elem.getAttribute("r")||0); + break; + case "ellipse": + $('#ellipse_panel').show(); + $('#ellipse_cx').val(elem.getAttribute("cx")||0); + $('#ellipse_cy').val(elem.getAttribute("cy")||0); + $('#ellipse_rx').val(elem.getAttribute("rx")||0); + $('#ellipse_ry').val(elem.getAttribute("ry")||0); + break; + case "line": + $('#line_panel').show(); + $('#line_x1').val(elem.getAttribute("x1")||0); + $('#line_y1').val(elem.getAttribute("y1")||0); + $('#line_x2').val(elem.getAttribute("x2")||0); + $('#line_y2').val(elem.getAttribute("y2")||0); + break; case "text": // jquery's show() always sets display to block $('#text_panel').show().css("display", "inline"); diff --git a/wave/svg-edit.xml b/wave/svg-edit.xml index 3bd4e5f9..b83c3689 100644 --- a/wave/svg-edit.xml +++ b/wave/svg-edit.xml @@ -47,7 +47,6 @@ Bottom
-
| @@ -63,9 +62,49 @@ + + + + + + + +
- +
+ | + + + + + + +
+ +
+ | + + + + + + + + +
+ +
+ | + + + + + + + + +
|