From 05253d1366f2962f710b807e2d56cb32fdda71f3 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sun, 13 Sep 2009 15:50:43 +0000 Subject: [PATCH] Finish Issue 40: grouping git-svn-id: http://svg-edit.googlecode.com/svn/trunk@633 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 5b096be8..c5ee2a2d 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -300,7 +300,7 @@ function BatchCommand(text) { this.rotateGrip.setAttribute("display", bShow); this.rotateGripConnector.setAttribute("display", bShow); var elem = this.selectedElement; - if(elem && elem.tagName == "text") bShow = "none"; + if(elem && (elem.tagName == "text" || elem.tagName == "g")) bShow = "none"; for (dir in this.selectorGrips) { this.selectorGrips[dir].setAttribute("display", bShow); } @@ -2028,12 +2028,14 @@ function BatchCommand(text) { if (selectedElements[1] == null) { // set our current stroke/fill properties to the element's var selected = selectedElements[0]; - cur_shape.fill = selected.getAttribute("fill"); - cur_shape.fill_opacity = selected.getAttribute("fill-opacity"); - cur_shape.stroke = selected.getAttribute("stroke"); - cur_shape.stroke_opacity = selected.getAttribute("stroke-opacity"); - cur_shape.stroke_width = selected.getAttribute("stroke-width"); - cur_shape.stroke_style = selected.getAttribute("stroke-dasharray"); + if (selected.tagName != "g") { + cur_shape.fill = selected.getAttribute("fill"); + cur_shape.fill_opacity = selected.getAttribute("fill-opacity"); + cur_shape.stroke = selected.getAttribute("stroke"); + cur_shape.stroke_opacity = selected.getAttribute("stroke-opacity"); + cur_shape.stroke_width = selected.getAttribute("stroke-width"); + cur_shape.stroke_style = selected.getAttribute("stroke-dasharray"); + } if (selected.tagName == "text") { cur_text.font_size = selected.getAttribute("font-size"); cur_text.font_family = selected.getAttribute("font-family");