mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Remove the requirement for autoResize to be set, so anyone can resize a RenderTarget
This commit is contained in:
parent
d4d6a4c308
commit
c81c6cecc8
1 changed files with 6 additions and 15 deletions
|
@ -203,12 +203,16 @@ var RenderTarget = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Resizes this Render Target.
|
||||
* Resizes this Render Target as long as the given width and height are different
|
||||
* to the current width and height.
|
||||
*
|
||||
* Deletes both the frame buffer and texture, if they exist and then re-creates
|
||||
* them using the new sizes.
|
||||
*
|
||||
* This method is called automatically by the pipeline during its resize handler.
|
||||
*
|
||||
* Previous to Phaser v3.85 this method would only run if `autoResize` was `true`,
|
||||
* it will now run regardless.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.RenderTarget#resize
|
||||
* @since 3.50.0
|
||||
|
@ -220,20 +224,7 @@ var RenderTarget = new Class({
|
|||
*/
|
||||
resize: function (width, height)
|
||||
{
|
||||
width = Math.round(width * this.scale);
|
||||
height = Math.round(height * this.scale);
|
||||
|
||||
if (width <= 0)
|
||||
{
|
||||
width = 1;
|
||||
}
|
||||
|
||||
if (height <= 0)
|
||||
{
|
||||
height = 1;
|
||||
}
|
||||
|
||||
if (this.autoResize && (width !== this.width || height !== this.height))
|
||||
if (this.willResize(width, height))
|
||||
{
|
||||
var renderer = this.renderer;
|
||||
|
||||
|
|
Loading…
Reference in a new issue