protected override void OnPointerReleased(PointerRoutedEventArgs e) { base.OnPointerReleased(e); base.OnPointerPressed(e); var currentPoint = e.GetCurrentPoint(this); var point = new Point(currentPoint.Position.X, currentPoint.Position.Y); var args = new FingerManipulationEventArgs { Point = point, Handled = true }; OnFingerUp(args); }
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); }
public static Cursor GetCursorFromPointsInSquare(double sideSize, Point end) { var halfSide = sideSize / 2; var center = new Point(halfSide, halfSide); var deg = Geometrics.GetDegress(Mapper.Map<Point>(center), end); var segment = GetHotSpotSegment(deg); return CursorFromSegment(segment); }
protected override void OnPointerPressed(PointerRoutedEventArgs e) { base.OnPointerPressed(e); var currentPoint = e.GetCurrentPoint(this); if (currentPoint.Properties.IsLeftButtonPressed) { var point = new Point(currentPoint.Position.X, currentPoint.Position.Y); var args = new FingerManipulationEventArgs { Point = point, Handled = true, Pointer = e.Pointer, }; OnFingerDown(args); } }
private static void ApplySeparationBetween(ICanvasItem item1, ICanvasItem item2, double separation) { var currentSeparation = GetHorizontalSpaceBetween(item1, item2); var deltaSeparation = separation - currentSeparation; var offset = new Point(deltaSeparation, 0); item2.Offset(offset); }