Permalink
Browse files

Added a few null checks to the paintRenderer method on the ParallaxRe…

…peatRendererComponent
  • Loading branch information...
1 parent 0b3e1f6 commit 1f8bcfe0f71d068635e1f79d452a618311956b4c @hybridmindset committed Oct 21, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/com/pblabs/rendering2D/ParallaxRepeatRendererComponent.as
@@ -121,7 +121,7 @@ package com.pblabs.rendering2D
protected function paintRenderer():void
{
- if(!scene || !bitmapData) return;
+ if(!scene || !scene.sceneView || !bitmapData) return;
if(bindScrollPositionToScene)
{
@@ -143,7 +143,8 @@ package com.pblabs.rendering2D
_repeatPosition.y = scrollPosition.y * ((1 - parallaxFactor.y) == 0 ? 1 : (1 - parallaxFactor.y) );
}
-
+ if(!size || size.x == 0 || size.y == 0) return;
+
if(!canvasBitmapData || canvasBitmapData.width != size.x || canvasBitmapData.height != size.y)
{
canvasBitmapData = new BitmapData(size.x, size.y, true, backgroundFill);

0 comments on commit 1f8bcfe

Please sign in to comment.