Translate() public method

public Translate ( float dx, float dy ) : void
dx float
dy float
return void
示例#1
0
        public void HandleTranslation(InteractiveImage image, float zoomFactory)
        {
            this.hoveredImage = image;
            hoveredImage.Hovered = true;
            
            pts_gathered++;

            if (isResizing)
            {
                return;
            }
            var handClosed = handData.FingerCount <= 1;
            if (isDragging)
            {
                hoveredImage.Translate((handData.PalmPoint.Value.X - startDragPoint.X) * zoomFactory, (handData.PalmPoint.Value.Y - startDragPoint.Y) * zoomFactory);
            }
            if (handClosed)
            {
                //if (pts_gathered % 2 == 0)
                    startDragPoint = new Point(handData.PalmPoint.Value.X, handData.PalmPoint.Value.Y, 0);
                /*else
                {
                    startDragPoint.X += handData.PalmPoint.Value.X;
                    startDragPoint.Y += handData.PalmPoint.Value.Y;

                    startDragPoint.X = startDragPoint.X / pts_gathered % 2;
                    startDragPoint.Y = startDragPoint.Y / pts_gathered % 2;
                }*/
            }
            isDragging = handClosed;
        }
示例#2
0
        public void HandleTranslation(InteractiveImage image, float zoomFactory)
        {
            this.hoveredImage    = image;
            hoveredImage.Hovered = true;

            pts_gathered++;

            if (isResizing)
            {
                return;
            }
            var handClosed = handData.FingerCount <= 1;

            if (isDragging)
            {
                hoveredImage.Translate((handData.PalmPoint.Value.X - startDragPoint.X) * zoomFactory, (handData.PalmPoint.Value.Y - startDragPoint.Y) * zoomFactory);
            }
            if (handClosed)
            {
                //if (pts_gathered % 2 == 0)
                startDragPoint = new Point(handData.PalmPoint.Value.X, handData.PalmPoint.Value.Y, 0);

                /*else
                 * {
                 *  startDragPoint.X += handData.PalmPoint.Value.X;
                 *  startDragPoint.Y += handData.PalmPoint.Value.Y;
                 *
                 *  startDragPoint.X = startDragPoint.X / pts_gathered % 2;
                 *  startDragPoint.Y = startDragPoint.Y / pts_gathered % 2;
                 * }*/
            }
            isDragging = handClosed;
        }
示例#3
0
        public void HandleTranslation(InteractiveImage image, float zoomFactory)
        {
            this.hoveredImage = image;
            hoveredImage.Hovered = true;

            if (isResizing)
            {
                return;
            }
            var handClosed = handData.FingerCount <= 1;
            if (isDragging)
            {
                hoveredImage.Translate((handData.PalmPoint.Value.X - startDragPoint.X) * zoomFactory, (handData.PalmPoint.Value.Y - startDragPoint.Y) * zoomFactory);
            }
            if (handClosed)
            {
                startDragPoint = new Point(handData.PalmPoint.Value.X, handData.PalmPoint.Value.Y, 0);
            }
            isDragging = handClosed;
        }
示例#4
0
        public void HandleTranslation(InteractiveImage image, float zoomFactory)
        {
            this.hoveredImage    = image;
            hoveredImage.Hovered = true;

            if (isResizing)
            {
                return;
            }
            var handClosed = handData.FingerCount <= 1;

            if (isDragging)
            {
                hoveredImage.Translate((handData.PalmPoint.Value.X - startDragPoint.X) * zoomFactory, (handData.PalmPoint.Value.Y - startDragPoint.Y) * zoomFactory);
            }
            if (handClosed)
            {
                startDragPoint = new Point(handData.PalmPoint.Value.X, handData.PalmPoint.Value.Y, 0);
            }
            isDragging = handClosed;
        }