var sw:Number = stage.stageWidth, var sh:Number = stage.stageHeight;
if( sw/sh < c.width/c.height ) // (or the opposite depending on the way of scaling) { c.width = Math.min(origW,sw); c.scaleY = c.scaleX = Math.min(1, c.scaleX); } else { c.height = Math.min(origH,sh); c.scaleX = c.scaleY = Math.min(1, c.scaleY); } |
No comments:
Post a Comment