예제 #1
0
            public override void BeforeRender()
            {
                PointD vec = new PointD(EndPoint.X - StartPoint.X, EndPoint.Y - StartPoint.Y);
                double mag = vec.Magnitude();

                if (EndPoint.X == StartPoint.X)
                {
                    this.dtdx = 0;
                }
                else
                {
                    this.dtdx = vec.X / (mag * mag);
                }

                if (EndPoint.Y == StartPoint.Y)
                {
                    this.dtdy = 0;
                }
                else
                {
                    this.dtdy = vec.Y / (mag * mag);
                }

                base.BeforeRender();
            }
		public override void BeforeRender ()
		{
			var vec = new PointD (EndPoint.X - StartPoint.X, EndPoint.Y - StartPoint.Y);
			double mag = vec.Magnitude ();

			if (EndPoint.X == StartPoint.X)
				dtdx = 0;
			else
				dtdx = vec.X / (mag * mag);

			if (EndPoint.Y == StartPoint.Y)
				dtdy = 0;
			else
				dtdy = vec.Y / (mag * mag);

			base.BeforeRender ();
		}