Merge pull request #1027 from thecodingmachine/fix_resize_helpcamera

Fixing "camera popup" always display on resize
This commit is contained in:
David Négrier 2021-05-11 10:05:52 +02:00 committed by GitHub
commit 5f6d9e060c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,15 +109,18 @@ export class HelpCameraSettingsScene extends DirtyScene {
public onResize(ev: UIEvent): void {
super.onResize(ev);
const middleX = this.getMiddleX();
const middleY = this.getMiddleY();
this.tweens.add({
targets: this.helpCameraSettingsElement,
x: middleX,
y: middleY,
duration: 1000,
ease: 'Power3'
});
if (this.helpCameraSettingsOpened) {
const middleX = this.getMiddleX();
const middleY = this.getMiddleY();
this.tweens.add({
targets: this.helpCameraSettingsElement,
x: middleX,
y: middleY,
duration: 1000,
ease: 'Power3'
});
this.dirty = true;
}
}
private getMiddleX() : number{