/Frameworks/AppKit/rhino.platform/CGAffineTransform.j
http://github.com/jfahrenkrug/MapKit-HelloWorld · Unknown · 62 lines · 62 code · 0 blank · 0 comment · 0 complexity · d94f8850ffd5627e5bbb768ea64ff688 MD5 · raw file
- i;12;CGGeometry.jc;2950;
- CGAffineTransformMake=function(a,b,c,d,tx,ty){
- return {a:a,b:b,c:c,d:d,tx:tx,ty:ty};
- };
- CGAffineTransformMakeIdentity=function(){
- return {a:1,b:0,c:0,d:1,tx:0,ty:0};
- };
- CGAffineTransformMakeCopy=function(_7){
- return {a:_7.a,b:_7.b,c:_7.c,d:_7.d,tx:_7.tx,ty:_7.ty};
- };
- CGAffineTransformMakeScale=function(sx,sy){
- return {a:sx,b:0,c:0,d:sy,tx:0,ty:0};
- };
- CGAffineTransformMakeTranslation=function(tx,ty){
- return {a:1,b:0,c:0,d:1,tx:tx,ty:ty};
- };
- CGAffineTransformTranslate=function(_c,tx,ty){
- return {a:_c.a,b:_c.b,c:_c.c,d:_c.d,tx:_c.tx+_c.a*tx+_c.c*ty,ty:_c.ty+_c.b*tx+_c.d*ty};
- };
- CGAffineTransformScale=function(_f,sx,sy){
- return {a:_f.a*sx,b:_f.b*sx,c:_f.c*sy,d:_f.d*sy,tx:_f.tx,ty:_f.ty};
- };
- CGAffineTransformConcat=function(lhs,rhs){
- return {a:lhs.a*rhs.a+lhs.b*rhs.c,b:lhs.a*rhs.b+lhs.b*rhs.d,c:lhs.c*rhs.a+lhs.d*rhs.c,d:lhs.c*rhs.b+lhs.d*rhs.d,tx:lhs.tx*rhs.a+lhs.ty*rhs.c+rhs.tx,ty:lhs.tx*rhs.b+lhs.ty*rhs.d+rhs.ty};
- };
- CGPointApplyAffineTransform=function(_14,_15){
- return {x:_14.x*_15.a+_14.y*_15.c+_15.tx,y:_14.x*_15.b+_14.y*_15.d+_15.ty};
- };
- CGSizeApplyAffineTransform=function(_16,_17){
- return {width:_16.width*_17.a+_16.height*_17.c,height:_16.width*_17.b+_16.height*_17.d};
- };
- CGAffineTransformIsIdentity=function(_18){
- return (_18.a==1&&_18.b==0&&_18.c==0&&_18.d==1&&_18.tx==0&&_18.ty==0);
- };
- CGAffineTransformEqualToTransform=function(lhs,rhs){
- return (lhs.a==rhs.a&&lhs.b==rhs.b&&lhs.c==rhs.c&&lhs.d==rhs.d&&lhs.tx==rhs.tx&&lhs.ty==rhs.ty);
- };
- CGStringCreateWithCGAffineTransform=function(_1b){
- return (" [[ "+_1b.a+", "+_1b.b+", 0 ], [ "+_1b.c+", "+_1b.d+", 0 ], [ "+_1b.tx+", "+_1b.ty+", 1]]");
- };
- CGAffineTransformCreateCopy=function(_1c){
- return {a:_1c.a,b:_1c.b,c:_1c.c,d:_1c.d,tx:_1c.tx,ty:_1c.ty};
- };
- CGAffineTransformMakeRotation=function(_1d){
- var sin=SIN(_1d),cos=COS(_1d);
- return {a:cos,b:sin,c:-sin,d:cos,tx:0,ty:0};
- };
- CGAffineTransformRotate=function(_20,_21){
- var sin=SIN(_21),cos=COS(_21);
- return {a:_20.a*cos+_20.c*sin,b:_20.b*cos+_20.d*sin,c:_20.c*cos-_20.a*sin,d:_20.d*cos-_20.b*sin,tx:_20.tx,ty:_20.ty};
- };
- CGAffineTransformInvert=function(_24){
- var _25=1/(_24.a*_24.d-_24.b*_24.c);
- return {a:_25*_24.d,b:-_25*_24.b,c:-_25*_24.c,d:_25*_24.a,tx:_25*(_24.c*_24.ty-_24.d*_24.tx),ty:_25*(_24.b*_24.tx-_24.a*_24.ty)};
- };
- CGRectApplyAffineTransform=function(_26,_27){
- var top=(_26.origin.y),_29=(_26.origin.x),_2a=(_26.origin.x+_26.size.width),_2b=(_26.origin.y+_26.size.height),_2c=CGPointApplyAffineTransform({x:_29,y:top},_27),_2d=CGPointApplyAffineTransform({x:_2a,y:top},_27),_2e=CGPointApplyAffineTransform({x:_29,y:_2b},_27),_2f=CGPointApplyAffineTransform({x:_2a,y:_2b},_27),_30=MIN(_2c.x,_2d.x,_2e.x,_2f.x),_31=MAX(_2c.x,_2d.x,_2e.x,_2f.x),_32=MIN(_2c.y,_2d.y,_2e.y,_2f.y),_33=MAX(_2c.y,_2d.y,_2e.y,_2f.y);
- return {origin:{x:_30,y:_32},size:{width:(_31-_30),height:(_33-_32)}};
- };
- CPStringFromCGAffineTransform=function(_34){
- return "{"+_34.a+", "+_34.b+", "+_34.c+", "+_34.d+", "+_34.tx+", "+_34.ty+"}";
- };