Created
July 11, 2012 20:00
-
-
Save mattlundstrom/3092911 to your computer and use it in GitHub Desktop.
AS3 Scale Around Point
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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