public override GraphicsBase CreateGraphics() { GraphicsBase b = new GraphicsPolyLine(points, lineWidth, objectColor, actualScale); if (this.ID != 0) { b.Id = this.ID; b.IsSelected = this.selected; } return b; }
public PropertiesGraphicsPolyLine(GraphicsPolyLine polyLine) { if (polyLine == null) { throw new ArgumentNullException("polyLine"); } points = polyLine.GetPoints(); lineWidth = polyLine.LineWidth; objectColor = polyLine.ObjectColor; actualScale = polyLine.ActualScale; ID = polyLine.Id; selected = polyLine.IsSelected; }
/// <summary> /// Create new object /// </summary> public override void OnMouseDown(DrawingCanvas drawingCanvas, MouseButtonEventArgs e) { Point p = e.GetPosition(drawingCanvas); newPolyLine = new GraphicsPolyLine( new Point[] { p, new Point(p.X + 1, p.Y + 1) }, drawingCanvas.LineWidth, drawingCanvas.ObjectColor, drawingCanvas.ActualScale); AddNewObject(drawingCanvas, newPolyLine); lastX = p.X; lastY = p.Y; }
public override void OnMouseUp(DrawingCanvas drawingCanvas, MouseButtonEventArgs e) { newPolyLine = null; base.OnMouseUp(drawingCanvas, e); }