diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 0b13c90..2c74de1 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -54,8 +54,8 @@ this.resolution = resolution || settings.RESOLUTION; - this.width = width; - this.height = height; + this.width = Math.ceil(width); + this.height = Math.ceil(height); this.realWidth = this.width * this.resolution; this.realHeight = this.height * this.resolution; @@ -95,6 +95,9 @@ */ resize(width, height) { + width = Math.ceil(width); + height = Math.ceil(height); + if (width === this.width && height === this.height) { return; diff --git a/src/core/textures/BaseRenderTexture.js b/src/core/textures/BaseRenderTexture.js index 0b13c90..2c74de1 100644 --- a/src/core/textures/BaseRenderTexture.js +++ b/src/core/textures/BaseRenderTexture.js @@ -54,8 +54,8 @@ this.resolution = resolution || settings.RESOLUTION; - this.width = width; - this.height = height; + this.width = Math.ceil(width); + this.height = Math.ceil(height); this.realWidth = this.width * this.resolution; this.realHeight = this.height * this.resolution; @@ -95,6 +95,9 @@ */ resize(width, height) { + width = Math.ceil(width); + height = Math.ceil(height); + if (width === this.width && height === this.height) { return; diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 31d264e..4fe047f 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -97,6 +97,9 @@ */ resize(width, height, doNotResizeBaseTexture) { + width = Math.ceil(width); + height = Math.ceil(height); + // TODO - could be not required.. this.valid = (width > 0 && height > 0);