message: Fixes cacheAsBitmap calculateBounds problem
diff: @@ -79,7 +79,7 @@ Object.defineProperties(DisplayObject.prototype, {
  data.originalRenderCanvas = this.renderCanvas;
  data.originalUpdateTransform = this.updateTransform;
  - data.originalCalculateBounds = this._calculateBounds;
  + data.originalCalculateBounds = this.calculateBounds;
  data.originalGetLocalBounds = this.getLocalBounds;
  data.originalDestroy = this.destroy;
  @@ -105,7 +105,7 @@ Object.defineProperties(DisplayObject.prototype, {
  this.render = data.originalRender;
  this.renderCanvas = data.originalRenderCanvas;
  - this._calculateBounds = data.originalCalculateBounds;
  + this.calculateBounds = data.originalCalculateBounds;
  this.getLocalBounds = data.originalGetLocalBounds;
  this.destroy = data.originalDestroy;
  @@ -218,7 +218,10 @@ DisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayOb
  // renderer.filterManager.filterStack = stack;
  this.render = this._renderCached;
  + // the rest is the same as for Canvas
  this.updateTransform = this.displayObjectUpdateTransform;
  + this.calculateBounds = this._calculateCachedBounds;
  + this.getLocalBounds = this._getCachedLocalBounds;
  this._mask = null;
  this.filterArea = null;
  @@ -232,10 +235,6 @@ DisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayOb
  cachedSprite.alpha = cacheAlpha;
  cachedSprite._bounds = this._bounds;
  - // easy bounds..
  - this._calculateBounds = this._calculateCachedBounds;
  - this.getLocalBounds = this._getCachedLocalBounds;
  -
  this._cacheData.sprite = cachedSprite;
  this.transform._parentID = -1;
  @@ -332,7 +331,10 @@ DisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDis
  renderer.context = cachedRenderTarget;
  this.renderCanvas = this._renderCachedCanvas;
  + // the rest is the same as for WebGL
  + this.updateTransform = this.displayObjectUpdateTransform;
  this.calculateBounds = this._calculateCachedBounds;
  + this.getLocalBounds = this._getCachedLocalBounds;
  this._mask = null;
  this.filterArea = null;
  @@ -343,9 +345,13 @@ DisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDis
  cachedSprite.transform.worldTransform = this.transform.worldTransform;
  cachedSprite.anchor.x = -(bounds.x / bounds.width);
  cachedSprite.anchor.y = -(bounds.y / bounds.height);
  - cachedSprite._bounds = this._bounds;
  cachedSprite.alpha = cacheAlpha;
  + cachedSprite._bounds = this._bounds;
  + this._cacheData.sprite = cachedSprite;
  +
  + this.transform._parentID = -1;
  + // restore the transform of the cached sprite to avoid the nasty flicker..
  if (!this.parent)
  {
  this.parent = renderer._tempDisplayObjectParent;
  @@ -357,10 +363,7 @@ DisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDis
  this.updateTransform();
  }
  - this.updateTransform = this.displayObjectUpdateTransform;
  -
  - this._cacheData.sprite = cachedSprite;
  -
  + // map the hit test..
  this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);
  };
  