Beispiel #1
0
        private void AddVerticalLine(CommandToken commandToken)
        {
            _currentPoint = commandToken.IsRelative
                                ? new Point(_currentPoint.X, _currentPoint.Y + commandToken.ReadDouble())
                                : _currentPoint.WithY(commandToken.ReadDouble());

            if (_isOpen == null)
            {
                CreateFigure();
            }

            _geometryContext.LineTo(_currentPoint);
        }
Beispiel #2
0
        private void AddArc(CommandToken commandToken)
        {
            var size = commandToken.ReadSize();

            var rotationAngle = commandToken.ReadDouble();

            var isLargeArc = commandToken.ReadBool();

            var sweepDirection = commandToken.ReadBool() ? SweepDirection.Clockwise : SweepDirection.CounterClockwise;

            var end = commandToken.IsRelative
                          ? commandToken.ReadRelativePoint(_currentPoint)
                          : commandToken.ReadPoint();

            if (_isOpen == null)
            {
                CreateFigure();
            }

            _geometryContext.ArcTo(end, size, rotationAngle, isLargeArc, sweepDirection);

            _currentPoint = end;

            _previousControlPoint = null;
        }