diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js
index 1340804f..e9122298 100644
--- a/editor/svgcanvas.js
+++ b/editor/svgcanvas.js
@@ -470,11 +470,22 @@ var canvas = this,
''+
''+
''+
+ '' +
+ '' +
+ '' +
+// '' +
+// '' +
+// '' +
''+
'').documentElement, true);
container.appendChild(svgroot);
+// This style element is for globally changing the opacity of
+// elements during in-group editing
+var root_style = svgdoc.createElementNS(svgns, "style");
+svgroot.appendChild(root_style);
+
// The actual element that represents the final output SVG element
var svgcontent = svgdoc.createElementNS(svgns, "svg");
$(svgcontent).attr({
@@ -1455,6 +1466,7 @@ var SelectorManager;
'fill': '#FFF',
'style': 'pointer-events:none'
});
+
// Both Firefox and WebKit are too slow with this filter region (especially at higher
// zoom levels) and Opera has at least one bug
// if (!window.opera) rect.setAttribute('filter', 'url(#canvashadow)');
@@ -1844,7 +1856,7 @@ var addSvgElementFromJson = this.addSvgElementFromJson = function(data) {
if (!shape) {
shape = svgdoc.createElementNS(svgns, data.element);
if (current_layer) {
- current_layer.appendChild(shape);
+ (current_group || current_layer).appendChild(shape);
}
}
if(data.curStyles) {
@@ -1893,6 +1905,12 @@ var all_layers = [],
// pointer to the current layer
current_layer = null,
+ // pointer to current group (for in-group editing)
+ current_group = null,
+
+ // Array with current disabled elements (for in-group editing)
+ disabled_elems = [],
+
// Object with save options
save_options = {round_digits: 5},
@@ -2054,14 +2072,16 @@ var round = this.round = function(val) {
var getIntersectionList = this.getIntersectionList = function(rect) {
if (rubberBox == null) { return null; }
+ var parent = current_group || current_layer;
+
if(!curBBoxes.length) {
// Cache all bboxes
- curBBoxes = getVisibleElements(current_layer, true);
+ curBBoxes = getVisibleElements(parent, true);
}
var resultList = null;
try {
- resultList = current_layer.getIntersectionList(rect, null);
+ resultList = parent.getIntersectionList(rect, null);
} catch(e) { }
if (resultList == null || typeof(resultList.item) != "function") {
@@ -4183,7 +4203,7 @@ var removeFromSelection = this.removeFromSelection = function(elemsToRemove) {
// Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function() {
if (current_layer) {
- selectOnly($(current_layer).children());
+ selectOnly($(current_group || current_layer).children());
current_mode = "select";
}
};
@@ -4253,7 +4273,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
return null;
}
var mouse_target = evt.target;
-
+
// if it was a