Skip to content

Instantly share code, notes, and snippets.

@slaskis
Created January 29, 2010 10:49
Show Gist options
  • Save slaskis/289639 to your computer and use it in GitHub Desktop.
Save slaskis/289639 to your computer and use it in GitHub Desktop.
public static function localToLocal( containerFrom : DisplayObject, containerTo : DisplayObject, origin : Point = null ) : Point {
var point : Point = origin ? origin : new Point( );
point = containerFrom.localToGlobal( point );
point = containerTo.globalToLocal( point );
return point;
}
function getZoomScale( min , max , step = 0 , steps = 3 ) {
var diff = max - min;
if( step == 0 )
return min;
if( step == steps )
return max;
return diff / ( 2 * ( steps - step ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment