PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 1i;12;CGGeometry.jc;2950;
 2CGAffineTransformMake=function(a,b,c,d,tx,ty){
 3return {a:a,b:b,c:c,d:d,tx:tx,ty:ty};
 4};
 5CGAffineTransformMakeIdentity=function(){
 6return {a:1,b:0,c:0,d:1,tx:0,ty:0};
 7};
 8CGAffineTransformMakeCopy=function(_7){
 9return {a:_7.a,b:_7.b,c:_7.c,d:_7.d,tx:_7.tx,ty:_7.ty};
10};
11CGAffineTransformMakeScale=function(sx,sy){
12return {a:sx,b:0,c:0,d:sy,tx:0,ty:0};
13};
14CGAffineTransformMakeTranslation=function(tx,ty){
15return {a:1,b:0,c:0,d:1,tx:tx,ty:ty};
16};
17CGAffineTransformTranslate=function(_c,tx,ty){
18return {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};
19};
20CGAffineTransformScale=function(_f,sx,sy){
21return {a:_f.a*sx,b:_f.b*sx,c:_f.c*sy,d:_f.d*sy,tx:_f.tx,ty:_f.ty};
22};
23CGAffineTransformConcat=function(lhs,rhs){
24return {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};
25};
26CGPointApplyAffineTransform=function(_14,_15){
27return {x:_14.x*_15.a+_14.y*_15.c+_15.tx,y:_14.x*_15.b+_14.y*_15.d+_15.ty};
28};
29CGSizeApplyAffineTransform=function(_16,_17){
30return {width:_16.width*_17.a+_16.height*_17.c,height:_16.width*_17.b+_16.height*_17.d};
31};
32CGAffineTransformIsIdentity=function(_18){
33return (_18.a==1&&_18.b==0&&_18.c==0&&_18.d==1&&_18.tx==0&&_18.ty==0);
34};
35CGAffineTransformEqualToTransform=function(lhs,rhs){
36return (lhs.a==rhs.a&&lhs.b==rhs.b&&lhs.c==rhs.c&&lhs.d==rhs.d&&lhs.tx==rhs.tx&&lhs.ty==rhs.ty);
37};
38CGStringCreateWithCGAffineTransform=function(_1b){
39return (" [[ "+_1b.a+", "+_1b.b+", 0 ], [ "+_1b.c+", "+_1b.d+", 0 ], [ "+_1b.tx+", "+_1b.ty+", 1]]");
40};
41CGAffineTransformCreateCopy=function(_1c){
42return {a:_1c.a,b:_1c.b,c:_1c.c,d:_1c.d,tx:_1c.tx,ty:_1c.ty};
43};
44CGAffineTransformMakeRotation=function(_1d){
45var sin=SIN(_1d),cos=COS(_1d);
46return {a:cos,b:sin,c:-sin,d:cos,tx:0,ty:0};
47};
48CGAffineTransformRotate=function(_20,_21){
49var sin=SIN(_21),cos=COS(_21);
50return {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};
51};
52CGAffineTransformInvert=function(_24){
53var _25=1/(_24.a*_24.d-_24.b*_24.c);
54return {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)};
55};
56CGRectApplyAffineTransform=function(_26,_27){
57var 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);
58return {origin:{x:_30,y:_32},size:{width:(_31-_30),height:(_33-_32)}};
59};
60CPStringFromCGAffineTransform=function(_34){
61return "{"+_34.a+", "+_34.b+", "+_34.c+", "+_34.d+", "+_34.tx+", "+_34.ty+"}";
62};