PrimaryFeather/Starling-Framework — Issue #56: Error #2183 when rendering a displayObject with scaleX or scaleY = 0
Author: boblemarin
Created: 2011-12-06 20:38:56+00:00
State: open

Hi Daniel,

After updating to 0.9.1, I started getting an error when Starling tries to render an Image whose scale values are equal to 0.

Having searched for a quick fix, I realized that adding more conditions in the render() method of the DisplayObjectContainer protected me from the error.

Here's what I've got (starting line 272) :

public override function render(support:RenderSupport, alpha:Number):void
{
alpha *= this.alpha;
var numChildren:int = mChildren.length;

for (var i:int=0; i 0 && child.height > 0 )
{
support.pushMatrix();
support.transformMatrix(child);
child.render(support, alpha);
support.popMatrix();
}
}
}

I don't know if there's a best way to do it. The error occurs when calling support.transformMatrix(child), so protecting the render method of the Image class didn't do the trick.