Renamed clone to duplicate and added ALT arrow and ALT drag duplicate
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1951 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
81ac3d75c6
commit
4da11c4924
|
@ -184,7 +184,7 @@
|
||||||
<div id="selected_panel">
|
<div id="selected_panel">
|
||||||
<div class="toolset">
|
<div class="toolset">
|
||||||
<div class="tool_sep"></div>
|
<div class="tool_sep"></div>
|
||||||
<div class="push_button" id="tool_clone" title="Clone Element [C]"></div>
|
<div class="push_button" id="tool_clone" title="Duplicate Element [D]"></div>
|
||||||
<div class="push_button" id="tool_delete" title="Delete Element [Delete/Backspace]"></div>
|
<div class="push_button" id="tool_delete" title="Delete Element [Delete/Backspace]"></div>
|
||||||
<div class="tool_sep"></div>
|
<div class="tool_sep"></div>
|
||||||
<div class="push_button" id="tool_move_top" title="Bring to Front [ Ctrl+Shift+] ]"></div>
|
<div class="push_button" id="tool_move_top" title="Bring to Front [ Ctrl+Shift+] ]"></div>
|
||||||
|
|
|
@ -2643,7 +2643,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var clickClone = function(){
|
var clickClone = function(){
|
||||||
svgCanvas.cloneSelectedElements();
|
svgCanvas.cloneSelectedElements(20,20);
|
||||||
};
|
};
|
||||||
|
|
||||||
var clickAlign = function() {
|
var clickAlign = function() {
|
||||||
|
@ -3944,7 +3944,7 @@
|
||||||
{sel:'#tool_make_link,#tool_make_link_multi', fn: makeHyperlink, evt: 'click'},
|
{sel:'#tool_make_link,#tool_make_link_multi', fn: makeHyperlink, evt: 'click'},
|
||||||
{sel:'#tool_undo', fn: clickUndo, evt: 'click', key: ['Z', true]},
|
{sel:'#tool_undo', fn: clickUndo, evt: 'click', key: ['Z', true]},
|
||||||
{sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]},
|
{sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]},
|
||||||
{sel:'#tool_clone,#tool_clone_multi', fn: clickClone, evt: 'click', key: ['C', true]},
|
{sel:'#tool_clone,#tool_clone_multi', fn: clickClone, evt: 'click', key: ['D', true]},
|
||||||
{sel:'#tool_group', fn: clickGroup, evt: 'click', key: ['G', true]},
|
{sel:'#tool_group', fn: clickGroup, evt: 'click', key: ['G', true]},
|
||||||
{sel:'#tool_ungroup', fn: clickGroup, evt: 'click'},
|
{sel:'#tool_ungroup', fn: clickGroup, evt: 'click'},
|
||||||
{sel:'#tool_unlink_use', fn: clickGroup, evt: 'click'},
|
{sel:'#tool_unlink_use', fn: clickGroup, evt: 'click'},
|
||||||
|
@ -3977,6 +3977,14 @@
|
||||||
{key: 'shift+down', fn: function(){moveSelected(0,10)}},
|
{key: 'shift+down', fn: function(){moveSelected(0,10)}},
|
||||||
{key: 'shift+left', fn: function(){moveSelected(-10,0)}},
|
{key: 'shift+left', fn: function(){moveSelected(-10,0)}},
|
||||||
{key: 'shift+right', fn: function(){moveSelected(10,0)}},
|
{key: 'shift+right', fn: function(){moveSelected(10,0)}},
|
||||||
|
{key: ['alt+up', true], fn: function(){svgCanvas.cloneSelectedElements(0,-1)}},
|
||||||
|
{key: ['alt+down', true], fn: function(){svgCanvas.cloneSelectedElements(0,1)}},
|
||||||
|
{key: ['alt+left', true], fn: function(){svgCanvas.cloneSelectedElements(-1,0)}},
|
||||||
|
{key: ['alt+right', true], fn: function(){svgCanvas.cloneSelectedElements(1,0)}},
|
||||||
|
{key: ['alt+shift+up', true], fn: function(){svgCanvas.cloneSelectedElements(0,-10)}},
|
||||||
|
{key: ['alt+shift+down', true], fn: function(){svgCanvas.cloneSelectedElements(0,10)}},
|
||||||
|
{key: ['alt+shift+left', true], fn: function(){svgCanvas.cloneSelectedElements(-10,0)}},
|
||||||
|
{key: ['alt+shift+right', true], fn: function(){svgCanvas.cloneSelectedElements(10,0)}},
|
||||||
{key: 'A', fn: function(){svgCanvas.selectAllInCurrentLayer();}},
|
{key: 'A', fn: function(){svgCanvas.selectAllInCurrentLayer();}},
|
||||||
|
|
||||||
// Standard shortcuts
|
// Standard shortcuts
|
||||||
|
|
|
@ -2485,6 +2485,10 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||||
|
|
||||||
var right_click = evt.button === 2;
|
var right_click = evt.button === 2;
|
||||||
|
|
||||||
|
if(evt.altKey) { // duplicate when dragging
|
||||||
|
svgCanvas.cloneSelectedElements(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
root_sctm = svgcontent.getScreenCTM().inverse();
|
root_sctm = svgcontent.getScreenCTM().inverse();
|
||||||
var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
||||||
mouse_x = pt.x * current_zoom,
|
mouse_x = pt.x * current_zoom,
|
||||||
|
@ -9362,7 +9366,7 @@ this.moveSelectedElements = function(dx, dy, undoable) {
|
||||||
// Function: cloneSelectedElements
|
// Function: cloneSelectedElements
|
||||||
// Create deep DOM copies (clones) of all selected elements and move them slightly
|
// Create deep DOM copies (clones) of all selected elements and move them slightly
|
||||||
// from their originals
|
// from their originals
|
||||||
this.cloneSelectedElements = function() {
|
this.cloneSelectedElements = function(x,y) {
|
||||||
var batchCmd = new BatchCommand("Clone Elements");
|
var batchCmd = new BatchCommand("Clone Elements");
|
||||||
// find all the elements selected (stop at first null)
|
// find all the elements selected (stop at first null)
|
||||||
var len = selectedElements.length;
|
var len = selectedElements.length;
|
||||||
|
@ -9385,7 +9389,7 @@ this.cloneSelectedElements = function() {
|
||||||
|
|
||||||
if (!batchCmd.isEmpty()) {
|
if (!batchCmd.isEmpty()) {
|
||||||
addToSelection(copiedElements.reverse()); // Need to reverse for correct selection-adding
|
addToSelection(copiedElements.reverse()); // Need to reverse for correct selection-adding
|
||||||
this.moveSelectedElements(20,20,false);
|
this.moveSelectedElements(x,y,false);
|
||||||
addCommandToHistory(batchCmd);
|
addCommandToHistory(batchCmd);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue