Skip to content

Commit 0d07723

Browse files
author
David Gillen
committed
correct missing viewport commands in cache draw
1 parent b6d019b commit 0d07723

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/easeljs/display/StageGL.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,7 @@ this.createjs = this.createjs||{};
14191419
var storeBatchTemp = this._batchTextureTemp;
14201420

14211421
var filterCount = manager._filterCount, filtersLeft = filterCount;
1422+
var backupWidth = this._viewportWidth, backupHeight = this._viewportHeight;
14221423
this._updateDrawingSurface(manager._drawWidth, manager._drawHeight);
14231424

14241425
this._batchTextureOutput = (manager._filterCount%2) ? manager._bufferTextureConcat : manager._bufferTextureOutput;
@@ -1460,7 +1461,7 @@ this.createjs = this.createjs||{};
14601461
this._batchTextureConcat = storeBatchConcat;
14611462
this._batchTextureTemp = storeBatchTemp;
14621463

1463-
this._updateDrawingSurface();
1464+
this._updateDrawingSurface(backupWidth, backupHeight);
14641465
return true;
14651466
};
14661467

@@ -1580,8 +1581,8 @@ this.createjs = this.createjs||{};
15801581
* @param {int} height The height of the render surface in pixels.
15811582
*/
15821583
p.updateViewport = function (width, height) {
1583-
this._viewportWidth = width|0;
1584-
this._viewportHeight = height|0;
1584+
width = Math.abs(width|0) || 1;
1585+
height = Math.abs(height|0) || 1;
15851586

15861587
this._updateDrawingSurface(width, height);
15871588

@@ -1799,14 +1800,14 @@ this.createjs = this.createjs||{};
17991800
/**
18001801
* Changes the active drawing surface and view matrix to the correct parameters without polluting the concept
18011802
* of the current stage size
1802-
* @param {uint} [w=_viewportWidth] The width of the surface in pixels, defaults to _viewportWidth
1803-
* @param {uint} [h=_viewportHeight] The height of the surface in pixels, defaults to _viewportHeight
1803+
* @param {uint} w The width of the surface in pixels, defaults to _viewportWidth
1804+
* @param {uint} h The height of the surface in pixels, defaults to _viewportHeight
18041805
*/
18051806
p._updateDrawingSurface = function(w, h) {
1806-
if(w === undefined){ w = this._viewportWidth; }
1807-
if(h === undefined){ h = this._viewportHeight; }
1807+
this._viewportWidth = w;
1808+
this._viewportHeight = h;
18081809

1809-
this._webGLContext.viewport(0, 0, w, h);
1810+
this._webGLContext.viewport(0, 0, this._viewportWidth, this._viewportHeight);
18101811

18111812
// WebGL works with a -1,1 space on its screen. It also follows Y-Up
18121813
// we need to flip the y, scale and then translate the co-ordinates to match this

0 commit comments

Comments
 (0)