Fix #5307
This commit is contained in:
parent
9153434906
commit
958ec7b03f
@ -37,6 +37,7 @@ export class Room {
|
|||||||
private selectedObject: THREE.Object3D = null;
|
private selectedObject: THREE.Object3D = null;
|
||||||
private onChangeSelect: Function;
|
private onChangeSelect: Function;
|
||||||
private isTransformMode = false;
|
private isTransformMode = false;
|
||||||
|
private renderFrameRequestId: number;
|
||||||
public canvas: HTMLCanvasElement;
|
public canvas: HTMLCanvasElement;
|
||||||
|
|
||||||
private get furnitures(): Furniture[] {
|
private get furnitures(): Furniture[] {
|
||||||
@ -299,7 +300,8 @@ export class Room {
|
|||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
private renderWithoutPostFXs() {
|
private renderWithoutPostFXs() {
|
||||||
requestAnimationFrame(this.renderWithoutPostFXs);
|
this.renderFrameRequestId =
|
||||||
|
window.requestAnimationFrame(this.renderWithoutPostFXs);
|
||||||
|
|
||||||
// Update animations
|
// Update animations
|
||||||
const clock = this.clock.getDelta();
|
const clock = this.clock.getDelta();
|
||||||
@ -313,7 +315,8 @@ export class Room {
|
|||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
private renderWithPostFXs() {
|
private renderWithPostFXs() {
|
||||||
requestAnimationFrame(this.renderWithPostFXs);
|
this.renderFrameRequestId =
|
||||||
|
window.requestAnimationFrame(this.renderWithPostFXs);
|
||||||
|
|
||||||
// Update animations
|
// Update animations
|
||||||
const clock = this.clock.getDelta();
|
const clock = this.clock.getDelta();
|
||||||
@ -688,4 +691,10 @@ export class Room {
|
|||||||
public findFurnitureById(id: string) {
|
public findFurnitureById(id: string) {
|
||||||
return this.furnitures.find(furniture => furniture.id === id);
|
return this.furnitures.find(furniture => furniture.id === id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public destroy() {
|
||||||
|
// Stop render loop
|
||||||
|
window.cancelAnimationFrame(this.renderFrameRequestId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,10 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
room.destroy();
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async add() {
|
async add() {
|
||||||
const { canceled, result: id } = await this.$root.dialog({
|
const { canceled, result: id } = await this.$root.dialog({
|
||||||
|
Loading…
Reference in New Issue
Block a user