feat: Stage::focus

This commit is contained in:
cha0s 2019-04-19 22:29:05 -05:00
parent 5b6e399c30
commit 8397c9ab5e

View File

@ -72,7 +72,6 @@ export class Stage extends decorate(Container) {
// Add to new parent (if any) and focus.
if (parent) {
parent.appendChild(this.element);
this.element.focus();
}
// Recalculate size and ratio.
this.onWindowResize();
@ -116,6 +115,10 @@ export class Stage extends decorate(Container) {
];
}
focus() {
this.element.focus();
}
onCameraChanged(oldCamera) {
if (oldCamera) {
oldCamera.off('realPositionChanged', this.onCameraRealPositionChanged);