Skip to content

Instantly share code, notes, and snippets.

@mattlundstrom
Created July 11, 2012 20:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattlundstrom/3092911 to your computer and use it in GitHub Desktop.
Save mattlundstrom/3092911 to your computer and use it in GitHub Desktop.
AS3 Scale Around Point
function scaleAroundPoint(target:DisplayObject, point:Point, scaleFactor:Number):void
{
var m:Matrix = target.transform.matrix;
m.translate( -point.x, -point.y );
m.scale( scaleFactor, scaleFactor);
m.translate( point.x, point.y );
target.transform.matrix = m;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment