fixed alt drag clone

master
Mark MacKay 2012-08-14 00:32:34 -05:00
parent 8ae1002d58
commit 4c48c49a61
4 changed files with 14 additions and 6 deletions

View File

@ -404,7 +404,12 @@ svgedit.draw.Drawing.prototype.identifyLayers = function() {
this.all_layers.push( [newname, a_layer] );
}
svgedit.utilities.walkTree(a_layer, function(e){e.setAttribute("style","pointer-events:inherit");});
this.current_layer = a_layer;
if (a_layer.getAttribute("data-locked") === "true") {
this.current_layer = this.all_layers.slice(-2)[0][1]
}
else {
this.current_layer = a_layer
}
this.current_layer.setAttribute("style","pointer-events:all");
};

View File

@ -56,7 +56,7 @@ var svgWhiteList_ = {
"feGaussianBlur": ["class", "color-interpolation-filters", "id", "requiredFeatures", "stdDeviation"],
"filter": ["class", "color-interpolation-filters", "filterRes", "filterUnits", "height", "id", "primitiveUnits", "requiredFeatures", "width", "x", "xlink:href", "y"],
"foreignObject": ["class", "font-size", "height", "id", "opacity", "requiredFeatures", "style", "transform", "width", "x", "y"],
"g": ["class", "clip-path", "clip-rule", "id", "display", "fill", "fill-opacity", "fill-rule", "filter", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "font-family", "font-size", "font-style", "font-weight", "text-anchor"],
"g": ["class", "clip-path", "clip-rule", "id", "display", "fill", "fill-opacity", "fill-rule", "filter", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "font-family", "font-size", "font-style", "font-weight", "text-anchor", "data-locked"],
"image": ["class", "clip-path", "clip-rule", "filter", "height", "id", "mask", "opacity", "requiredFeatures", "style", "systemLanguage", "transform", "width", "x", "xlink:href", "xlink:title", "y"],
"line": ["shape-rendering", "class", "clip-path", "clip-rule", "fill", "fill-opacity", "fill-rule", "filter", "id", "marker-end", "marker-mid", "marker-start", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "x1", "x2", "y1", "y2"],
"linearGradient": ["class", "id", "gradientTransform", "gradientUnits", "requiredFeatures", "spreadMethod", "systemLanguage", "x1", "x2", "xlink:href", "y1", "y2"],

View File

@ -1817,7 +1817,6 @@
w_area.scrollTop -= (evt.clientY - last_y);
last_x = evt.clientX;
last_y = evt.clientY;
if(evt.type === 'mouseup' || evt.type === 'touchend') panning = false;
return false;
}

View File

@ -2729,7 +2729,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
// in this function we do not record any state changes yet (but we do update
// any elements that are still being created, moved or resized on the canvas)
var mouseMove = function(evt) {
if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return;
if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return;
if (!started) return;
if(evt.button === 1 || canvas.spaceKey) return;
var selected = selectedElements[0],
@ -8637,13 +8637,17 @@ this.cloneSelectedElements = function(x,y, drag) {
// clone each element and replace it within copiedElements
var elem = copiedElements[i]
var clone = copyElem(copiedElements[i]);
var parent = (current_group || getCurrentDrawing().getCurrentLayer())
if (drag) {
//removed the dragged transform until that moment
tlist = getTransformList(clone)
tlist.removeItem(drag)
tlist.removeItem(drag)
recalculateDimensions(clone)
parent.insertBefore(clone, elem);
}
else {
parent.appendChild(clone);
}
(current_group || getCurrentDrawing().getCurrentLayer()).appendChild(clone);
clones.push(clone)
batchCmd.addSubCommand(new InsertElementCommand(clone));
}