mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Flock example: space bar toggles selection state of items in the document.
This commit is contained in:
parent
b1d8922fd1
commit
de466edc23
1 changed files with 6 additions and 0 deletions
|
@ -273,6 +273,12 @@
|
|||
groupTogether = !groupTogether;
|
||||
}
|
||||
|
||||
var layer = document.activeLayer;
|
||||
function onKeyDown(event) {
|
||||
if (event.character == 'space')
|
||||
layer.selected = !layer.selected;
|
||||
}
|
||||
|
||||
// Resize the document, whenever the window is resized,
|
||||
window.onresize = function(event) {
|
||||
document.size = [window.innerWidth, window.innerHeight];
|
||||
|
|
Loading…
Reference in a new issue