Skip to content

Commit

Permalink
fix(main): prevent postprocess renderer from being resized to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Jul 25, 2024
1 parent 86b265d commit eea990c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.1.8",
"version": "2.1.9",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
4 changes: 3 additions & 1 deletion packages/front/src/core/PostproductionRenderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export class PostproductionRenderer extends RendererWith2D {
}

private setPostproductionSize(size?: THREE.Vector2) {
if (!this.container) return;
if (!this.container) {
return;
}
const width = size ? size.x : this.container.clientWidth;
const height = size ? size.y : this.container.clientHeight;
this.postproduction.setSize(width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ export class Postproduction {
* @returns {void}
*/
setSize(width: number, height: number) {
if (width === 0 || height === 0) {
return;
}
if (this._initialized) {
const customEnabled = this._settings.custom;
if (customEnabled) {
Expand Down

0 comments on commit eea990c

Please sign in to comment.