Permalink
Browse files

Updated clearRect usages to increase by 1 pixel to avoid Android cras…

…hes.

Signed-off-by: Lanny McNie <lanny@gskinner.com>
  • Loading branch information...
lannymcnie committed May 1, 2013
1 parent 0c781ee commit 7c02f0d4a7e50908b284623d23e6897f15e3bff4
@@ -1,27 +1,30 @@
Version NEXT [Not released]
****************************************************************************************************
- Updated demos to propagate the tick event to the stage. This is a best practice.
- Fixed documentation for Matrix2D.rotate
- Fixed documentation for Matrix2D.tx
- Fixed documentation for Stage.stagemousedown event (stagemouseup was doc'd twice)
- Fixed documentation of DisplayObject.dblclick (case incorrect)
- Updated demos:
* propagate the tick event to the stage. This is a best practice.
* Added AlphaMaskFilter demo.
* Added a "Graphics Winding" demo
* Added Safari note to the Cache demo
- Updated documentation:
* Matrix2D.rotate
* Matrix2D.tx named incorrectly
* Stage.stagemousedown event (stagemouseup was doc'd twice)
* DisplayObject.dblclick (case incorrect)
* Fixed example in Stage documentation (incorrect)
* Fixed example in Text documentation (missing quote)
* Fixed updateContext method name in docs (was incorrectly set to "setupContext")
* Added sample code to MovieClip documentation, and a MovieClip example.
* Added optional parameters to MovieClip constructor
* Updated description of DisplayObject.mouseEnabled
* Fixed setPaused/getPaused descriptions in Ticker, and added some better descriptions, a few examples, and updated
documentation throughout.
* Updated SpriteSheetUtils/extractFrame documentation to mention Bitmap/sourceRect and security concerns
* Updated Bitmap/cache methods to clarify caching usage for Bitmaps
* Updated optional parameter for DisplayObject/cache
- Modified EventDispatcher to avoid unnecessary instanceof and apply
- Fixed example in Stage documentation (incorrect)
- Fixed example in Text documentation (missing quote)
- Fixed updateContext method name in docs (was incorrectly set to "setupContext")
- Added sample code to MovieClip documentation, and a MovieClip example.
- Added optional parameters to MovieClip constructor.
- Added AlphaMaskFilter demo.
- Fixed documentation description of DisplayObject.mouseEnabled
- Added Safari note to the Cache example.
- Updated Ticker documentation. Fixed setPaused/getPaused descriptions, and added some better descriptions,
a few examples, and updated documentation throughout.
- Updated SpriteSheetUtils/extractFrame documentation to mention Bitmap/sourceRect and security concerns.
- Updated Bitmap/cache methods to clarify caching usage for Bitmaps
- Updated optional parameter for DisplayObject/cache
- Replaced the width=0 hack (for clearing canvases) with a setTransform/clearRect in DisplayObject,
Container, and SpriteSheetUtils.
- Added a "Graphics Winding" example
- Updated clearRect usages to use +1 on width and height to prevent crashes on Android (thanks mikelito)
Version 0.6.0 [Feb 12, 2013]

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -481,7 +481,7 @@ var p = Container.prototype = new createjs.DisplayObject();
this.draw(ctx);
if (this._testHit(ctx)) {
ctx.setTransform(1, 0, 0, 1, 0, 0)
ctx.clearRect(0,0,1,1);
ctx.clearRect(0, 0, 2, 2);
return this;
}
}
@@ -517,8 +517,8 @@ var p = Container.prototype = new createjs.DisplayObject();
ctx.setTransform(mtx.a, mtx.b, mtx.c, mtx.d, mtx.tx-x, mtx.ty-y);
(hitArea||child).draw(ctx);
if (!this._testHit(ctx)) { continue; }
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, 1, 1);
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, 2, 2);
if (hasHandler) { return this; }
else if (arr) { arr.push(child); }
else { return child; }
@@ -670,7 +670,7 @@ var p = DisplayObject.prototype;
if (!cacheCanvas) { throw "cache() must be called before updateCache()"; }
var ctx = cacheCanvas.getContext("2d");
ctx.save();
if (!compositeOperation) { ctx.clearRect(0, 0, cacheCanvas.width, cacheCanvas.height); }
if (!compositeOperation) { ctx.clearRect(0, 0, cacheCanvas.width+1, cacheCanvas.height+1); }
ctx.globalCompositeOperation = compositeOperation;
ctx.setTransform(scale, 0, 0, scale, -offX, -offY);
this.draw(ctx, true);
@@ -849,7 +849,7 @@ var p = DisplayObject.prototype;
var hit = this._testHit(ctx);
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, 1, 1);
ctx.clearRect(0, 0, 2, 2);
return hit;
};
@@ -310,7 +310,7 @@ var p = Stage.prototype = new createjs.Container();
if (!this.canvas) { return; }
var ctx = this.canvas.getContext("2d");
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
ctx.clearRect(0, 0, this.canvas.width+1, this.canvas.height+1);
}
/**
@@ -357,7 +357,7 @@ var p = Stage.prototype = new createjs.Container();
if(backgroundColor) {
//clear the canvas
ctx.clearRect (0, 0, w, h);
ctx.clearRect (0, 0, w+1, h+1);
//restore it with original settings
ctx.putImageData(data, 0, 0);
@@ -157,7 +157,7 @@ var SpriteSheetUtils = function() {
var src = imgs[i];
src.__tmp = i; // a bit hacky, but faster than doing indexOf below.
ctx.setTransform(1,0,0,1,0,0);
ctx.clearRect(0,0,canvas.width,canvas.height);
ctx.clearRect(0,0,canvas.width+1,canvas.height+1);
canvas.width = src.width;
canvas.height = src.height;
ctx.setTransform(h?-1:1, 0, 0, v?-1:1, h?src.width:0, v?src.height:0);
@@ -22,6 +22,6 @@ o.version = /*version*/"NEXT"; // injected by build process
* @type String
* @static
**/
o.buildDate = /*date*/"Tue, 09 Apr 2013 19:05:37 GMT"; // injected by build process
o.buildDate = /*date*/"Wed, 01 May 2013 19:27:11 GMT"; // injected by build process
})();

0 comments on commit 7c02f0d

Please sign in to comment.