diff --git a/src/extras/cacheAsBitmap.js b/src/extras/cacheAsBitmap.js index 37e55d2..aea06a8 100644 --- a/src/extras/cacheAsBitmap.js +++ b/src/extras/cacheAsBitmap.js @@ -227,7 +227,16 @@ this.transform._parentID = -1; // restore the transform of the cached sprite to avoid the nasty flicker.. - this.updateTransform(); + if (!this.parent) + { + this.parent = renderer._tempDisplayObjectParent; + this.updateTransform(); + this.parent = null; + } + else + { + this.updateTransform(); + } // map the hit test.. this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite); @@ -314,7 +323,17 @@ cachedSprite._bounds = this._bounds; cachedSprite.alpha = cacheAlpha; - this.updateTransform(); + if (!this.parent) + { + this.parent = renderer._tempDisplayObjectParent; + this.updateTransform(); + this.parent = null; + } + else + { + this.updateTransform(); + } + this.updateTransform = this.displayObjectUpdateTransform; this._cacheData.sprite = cachedSprite;