Esempio n. 1
0
        //~~~~~~~~~~
        public void SetScaleCenter(double tsx, double tsy)
        {
            if (tsx < 0.1)
            {
                return;
            }
            if (tsy < 0.1)
            {
                return;
            }

            pf_UpdateMatrix(delegate(Matrix tmtr)
            {
                double tysx = RxGeom.GetScaleX(tmtr);
                double tysy = RxGeom.GetScaleY(tmtr);

                double tnsx = RxGeom.DoubleRound(tsx);
                double tnsy = RxGeom.DoubleRound(tsy);

                if ((tysx != tnsx) && (tysy != tnsy))
                {
                    double tcx = RxGeom.GetLeftCenter(_rctBounds);
                    double tcy = RxGeom.GetTopCenter(_rctBounds);
                    tmtr.Translate(-tcx, -tcy);

                    double tbsx = 1 / tysx;
                    double tbsy = 1 / tysy;
                    tmtr.Scale(tbsx, tbsy);
                    tmtr.Scale(tnsx, tnsy);
                    tmtr.Translate(tcx, tcy);
                }

                return(tmtr);
            });
        }
Esempio n. 2
0
 /// <summary>
 /// 한바퀴 돌아간 라디안 보정
 /// </summary>
 /// <param name="trd"></param>
 /// <returns></returns>
 public static double CheckRadian(double trd)
 {
     if (trd < 0)
     {
         trd = RxGeom.FullRadianHalf + trd;
     }
     else if (trd >= RxGeom.FullRadianHalf)
     {
         trd = trd - RxGeom.FullRadian;
     }
     return(RxGeom.DoubleRound(trd));
 }