/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

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