private static StylusShape GetStylusShape(DrawingAttributes drawingAttribute) { StylusShape stylusShape = (drawingAttribute.StylusTip != 0) ? ((StylusShape) new EllipseStylusShape(drawingAttribute.Width, drawingAttribute.Height)) : ((StylusShape) new RectangleStylusShape(drawingAttribute.Width, drawingAttribute.Height)); stylusShape.Transform = drawingAttribute.StylusTipTransform; return(stylusShape); }
internal EllipticalNodeOperations(StylusShape nodeShape) : base(nodeShape) { _radii = new Size(nodeShape.Width * 0.5, nodeShape.Height * 0.5); _radius = Math.Max(_radii.Width, _radii.Height); _transform = nodeShape.Transform; _nodeShapeToCircle = _transform; _nodeShapeToCircle.Invert(); if (DoubleUtil.AreClose(_radii.Width, _radii.Height)) { _circleToNodeShape = _transform; return; } if (!DoubleUtil.IsZero(nodeShape.Rotation)) { _nodeShapeToCircle.Rotate(0.0 - nodeShape.Rotation); } double scaleX; double scaleY; if (_radii.Width > _radii.Height) { scaleX = 1.0; scaleY = _radii.Width / _radii.Height; } else { scaleX = _radii.Height / _radii.Width; scaleY = 1.0; } _nodeShapeToCircle.Scale(scaleX, scaleY); _circleToNodeShape = _nodeShapeToCircle; _circleToNodeShape.Invert(); }
internal static StrokeNodeOperations CreateInstance(StylusShape nodeShape) { if (nodeShape == null) { throw new ArgumentNullException("nodeShape"); } if (nodeShape.IsEllipse) { return(new EllipticalNodeOperations(nodeShape)); } return(new StrokeNodeOperations(nodeShape)); }
internal StrokeNodeOperations(StylusShape nodeShape) { _vertices = nodeShape.GetVerticesAsVectors(); }
internal StrokeNodeIterator(StylusShape nodeShape) : this(null, StrokeNodeOperations.CreateInstance(nodeShape), false) { }