Ejemplo n.º 1
0
        public void CheckMousePositionForLine(Line line, Point mousePos)
        {
            if (Math.Abs(mousePos.X - line.X1) < 10 || Math.Abs(mousePos.Y - line.Y1) < 10)
            {
                MouseType = ShapeMouseEventType.MouseOnLineX1;
                Window.Current.CoreWindow.PointerCursor = _sizeAll;
            }

            if (Math.Abs(mousePos.X - line.X2) < 10 || Math.Abs(mousePos.Y - line.Y2) < 10)
            {
                MouseType = ShapeMouseEventType.MouseOnLineX2;
                Window.Current.CoreWindow.PointerCursor = _sizeAll;
            }
        }
Ejemplo n.º 2
0
 public void CheckMousePositionForRectangle(double width, double height, Point mousePos)
 {
     if (mousePos.X <= 10 || mousePos.X > width - 10)
     {
         MouseType = ShapeMouseEventType.SizeLeftRigt;
         Window.Current.CoreWindow.PointerCursor = _sizeWestEastCursor;
     }
     else if (mousePos.Y <= 10 || mousePos.Y > height - 10)
     {
         MouseType = ShapeMouseEventType.SizeUpDown;
         Window.Current.CoreWindow.PointerCursor = _sizeNorthSouthCursor;
     }
     else
     {
         ResetPointer();
     }
 }
Ejemplo n.º 3
0
 public void CheckMousePositionForCircle(double width, double height, Point mousePos)
 {
     if (mousePos.X <= 10 || mousePos.X > width - 10)
     {
         MouseType = ShapeMouseEventType.MouseOnCircleX;
         Window.Current.CoreWindow.PointerCursor = _sizeWestEastCursor;
     }
     else if (mousePos.Y <= 10 || mousePos.Y > height - 10)
     {
         MouseType = ShapeMouseEventType.MouseOnCircleY;
         Window.Current.CoreWindow.PointerCursor = _sizeNorthSouthCursor;
     }
     else
     {
         ResetPointer();
     }
 }
Ejemplo n.º 4
0
 public void ResetPointer()
 {
     MouseType = ShapeMouseEventType.Dragging;
     Window.Current.CoreWindow.PointerCursor = _arrowCursor;
 }
Ejemplo n.º 5
0
 private void OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
 {
     _mouseType = _shapePointer.MouseType;
     this.SelectedShape.Opacity = 0.4;
 }