mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Resize to match texture fbo
This commit is contained in:
parent
c33a5598ab
commit
87b96f60e8
1 changed files with 1 additions and 10 deletions
|
@ -259,16 +259,7 @@ var RenderTarget = new Class({
|
|||
var textureWidth = this.width;
|
||||
var textureHeight = this.height;
|
||||
|
||||
var rendererWidth = renderer.width;
|
||||
var rendererHeight = renderer.height;
|
||||
|
||||
var width = Math.max(textureWidth, rendererWidth);
|
||||
var height = Math.max(textureHeight, rendererHeight);
|
||||
|
||||
var x = 0;
|
||||
var y = (textureHeight < rendererHeight) ? textureHeight - rendererHeight : Math.abs(rendererHeight - textureHeight);
|
||||
|
||||
renderer.gl.viewport(x, y, width, height);
|
||||
renderer.gl.viewport(0, 0, textureWidth, textureHeight);
|
||||
renderer.gl.disable(renderer.gl.SCISSOR_TEST);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue