Exemplo n.º 1
0
        public static IPoint GetHandlePoint(this IRect rect, ISize parentSize)
        {
            var middleThumb = rect.MiddlePoint();

            var propX = MathOperations.SquareRounding(middleThumb.X, parentSize.Width, 3) / 3D;
            var propY = MathOperations.SquareRounding(middleThumb.Y, parentSize.Height, 3) / 3D;

            return(new Point(propX, propY));
        }
        public Cursor GetCursor(IRect handleRect, IRect parentRect)
        {
            var discretizedHandle = handleRect.MiddlePoint();
            var edgeSizeOfEquivalentSquare = parentRect.Size.EdgeOfEquivaletSquare();

            var x = Geometrics.LinearProportion(discretizedHandle.X, parentRect.Width, edgeSizeOfEquivalentSquare);
            var y = Geometrics.LinearProportion(discretizedHandle.Y, parentRect.Height, edgeSizeOfEquivalentSquare);

            var equivalentDiscretizedHandle = new Point(x, y);

            return GetCursorFromPointsInSquare(edgeSizeOfEquivalentSquare, equivalentDiscretizedHandle);
        }
Exemplo n.º 3
0
        public Cursor GetCursor(IRect handleRect, IRect parentRect)
        {
            var discretizedHandle          = handleRect.MiddlePoint();
            var edgeSizeOfEquivalentSquare = parentRect.Size.EdgeOfEquivaletSquare();

            var x = Geometrics.LinearProportion(discretizedHandle.X, parentRect.Width, edgeSizeOfEquivalentSquare);
            var y = Geometrics.LinearProportion(discretizedHandle.Y, parentRect.Height, edgeSizeOfEquivalentSquare);

            var equivalentDiscretizedHandle = new Point(x, y);

            return(GetCursorFromPointsInSquare(edgeSizeOfEquivalentSquare, equivalentDiscretizedHandle));
        }