/// <summary> /// Rotates the strokes to the same angle as outline. /// </summary> void rotateHandle_DragCompleted(object sender, DragCompletedEventArgs e) { if (rotation == null) { return; } visualChildren.Remove(rotatePreview); (linkStroke as LinkStroke).RotateStroke(rotation.Angle - lastAngle); DrawingService.UpdateLinks(new StrokeCollection { linkStroke }); strokeBounds = linkStroke.GetBounds(); center = linkStroke.GetCenter(); // Save the angle of the last rotation. lastAngle = 0; linkStroke.rotation = 0; canvas.RefreshChildren(); // Redraw rotateHandle. InvalidateArrange(); }
void All_DragCompleted(object sender, DragCompletedEventArgs e) { Point actualPos = Mouse.GetPosition(this); if (e.HorizontalChange == 0 && e.VerticalChange == 0) { visualChildren.Remove(resizePreview); InvalidateArrange(); return; } visualChildren.Remove(resizePreview); canvas.ResizeShape(customStroke, NewRectangle, OldRectangle); canvas.RefreshLinks(false); canvas.RefreshChildren(); InvalidateArrange(); DrawingService.UpdateShapes(new StrokeCollection { customStroke }); }
void Move_DragCompleted(object sender, DragCompletedEventArgs e) { if (e.HorizontalChange == 0 && e.VerticalChange == 0) { visualChildren.Remove(resizePreview); InvalidateArrange(); return; } visualChildren.Remove(resizePreview); canvas.MoveShape(NewRectangle.Rect.X - OldRectangle.Rect.X, NewRectangle.Rect.Y - OldRectangle.Rect.Y); canvas.RefreshLinks(false); canvas.RefreshChildren(); InvalidateArrange(); DrawingService.UpdateShapes(strokesSelected); }
void dragHandle_DragCompleted(object sender, DragCompletedEventArgs e) { Point actualPos = Mouse.GetPosition(this); if (actualPos.X < 0 || actualPos.Y < 0) { visualChildren.Clear(); InvalidateArrange(); return; } linkStroke.path.Insert(indexInPath, new Coordinates(actualPos)); linkStroke.addStylusPointsToLink(); DrawingService.UpdateLinks(new StrokeCollection { linkStroke }); canvas.RefreshChildren(); InvalidateArrange(); visualChildren.Clear(); }