Exemplo n.º 1
0
        private static PointDouble GetMoveHandleCanvasOffset(PointInt32 originPoint, double hairWidth, SizeDouble moveHandleActualSize)
        {
            VectorDouble vec  = new VectorDouble(1.0, 1.0);
            VectorDouble num3 = (VectorDouble)(VectorDouble.Normalize(vec) * (hairWidth * 25.0));
            double       x    = UIUtil.ScaleWidth(num3.X);
            VectorDouble num4 = new VectorDouble(x, UIUtil.ScaleHeight(num3.Y));
            PointDouble  num5 = new PointDouble((double)(originPoint.X + 1), (double)(originPoint.Y + 1));
            PointDouble  pt   = num5 + num4;

            return(PointDouble.Offset(pt, -moveHandleActualSize.Width / 2.0, -moveHandleActualSize.Height / 2.0));
        }
Exemplo n.º 2
0
        private static PointDouble GetMoveHandleCanvasOffset(PointDouble gradientStartPoint, PointDouble gradientEndPoint, double hairWidth, SizeDouble moveHandleActualSize)
        {
            VectorDouble num2;
            VectorDouble num = (VectorDouble)(gradientEndPoint - gradientStartPoint);

            if (num.LengthSquared <= double.Epsilon)
            {
                num2 = new VectorDouble(1.0, 1.0);
            }
            else
            {
                num2 = num;
            }
            VectorDouble num4 = (VectorDouble)(VectorDouble.Normalize(num2) * (hairWidth * 35.0));
            double       x    = UIUtil.ScaleWidth(num4.X);
            VectorDouble num5 = new VectorDouble(x, UIUtil.ScaleHeight(num4.Y));
            PointDouble  pt   = gradientEndPoint + num5;

            return(PointDouble.Offset(pt, -moveHandleActualSize.Width / 2.0, -moveHandleActualSize.Height / 2.0));
        }