Fix Issue 412: Press 'A' to select all elements in the current layer

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1312 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-01-31 20:17:50 +00:00
parent 3e94e85e31
commit 31ec4fec91
2 changed files with 19 additions and 6 deletions

View File

@@ -2217,7 +2217,7 @@ function BatchCommand(text) {
while (i--) {
var elem = elemsToAdd[i];
// we ignore any selectors
if (!elem || elem.id.substr(0,13) == "selectorGrip_") continue;
if (!elem || elem.id.substr(0,13) == "selectorGrip_" || !this.getBBox(elem)) continue;
// if it's not already there, add it
if (selectedElements.indexOf(elem) == -1) {
selectedElements[j] = elem;
@@ -5656,6 +5656,18 @@ function BatchCommand(text) {
}
}
};
// Function: selectAllInCurrentLayer
// Clears the selection, then adds all elements in the current layer to the selection.
// This function then fires the selected event.
this.selectAllInCurrentLayer = function() {
if (current_layer) {
canvas.clearSelection();
canvas.addToSelection($(current_layer).children());
current_mode = "select";
call("selected", selectedElements);
}
};
// Function: clear
// Clears the current document. This is not an undoable action.