Interesting way of defining drawRect:

Hey guys,
I’m currently working my way through Joey Lott and Danny Patterson’s Actionscript 3 with Design Patterns book and ran into this code:


// var center is a boolean:
// var shapeWidth and shapeHeight are just Numbers that get passed in from a function.

var shape:Sprite = new Sprite();
addChild(shape);
			
shape.graphics.lineStyle(0,0,0);
shape.graphics.beginFill(0xFFFFFF);
shape.graphics.drawRect(center ? -shapeWidth / 2 : 0, center ? -shapeHeight / 2 : 0, shapeWidth, shapeHeight);
shape.graphics.endFill();

I’m confused by the “?” and the " : 0 ".

Could someone please explain how the drawRect is working in plain english? It looks totally awesome but I’ve never come across something like that.

Thanks for your time!