mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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;
|
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,
|
// Resize the document, whenever the window is resized,
|
||||||
window.onresize = function(event) {
|
window.onresize = function(event) {
|
||||||
document.size = [window.innerWidth, window.innerHeight];
|
document.size = [window.innerWidth, window.innerHeight];
|
||||||
|
|
Loading…
Reference in a new issue