Skip to content

Commit 68b055b

Browse files
CGhbouvetCGjupoulton
authored andcommitted
fix(gameengine): switch desired height and width to bounds
1 parent 81e9725 commit 68b055b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

engine/modules/entities/src/main/resources/view/entity-module/BufferedGroup.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ export class BufferedGroup extends ContainerBasedEntity {
1414

1515
postUpdate () {
1616
if (this.needsRender) {
17-
if (this.gameTexture == null || this.gameTexture.width < this.buffer.width || this.gameTexture.height < this.buffer.height) {
18-
const width = Math.min(Math.max(this.buffer.width, 512), 4096)
19-
const height = Math.min(Math.max(this.buffer.height, 512), 4096)
17+
const bufferBoundsWidth = this.buffer.getBounds().width
18+
const bufferBoundsHeight = this.buffer.getBounds().height
19+
if (this.gameTexture == null || this.gameTexture.width < bufferBoundsWidth || this.gameTexture.height < bufferBoundsHeight) {
20+
const width = Math.min(Math.max(bufferBoundsWidth, 512), 4096)
21+
const height = Math.min(Math.max(bufferBoundsHeight, 512), 4096)
2022
this.gameTexture = PIXI.RenderTexture.create(width, height)
2123
flagForDestructionOnReinit(this.gameTexture)
2224
this.graphics.texture = this.gameTexture

0 commit comments

Comments
 (0)