|
|
@ -259,7 +259,7 @@ namespace Avalonia.Media |
|
|
{ |
|
|
{ |
|
|
ThrowIfDisposed(); |
|
|
ThrowIfDisposed(); |
|
|
|
|
|
|
|
|
_currentPoint = relative |
|
|
var next = relative |
|
|
? ReadRelativePoint(ref span, _currentPoint) |
|
|
? ReadRelativePoint(ref span, _currentPoint) |
|
|
: ReadPoint(ref span); |
|
|
: ReadPoint(ref span); |
|
|
|
|
|
|
|
|
@ -268,14 +268,15 @@ namespace Avalonia.Media |
|
|
CreateFigure(); |
|
|
CreateFigure(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_geometryContext.LineTo(_currentPoint); |
|
|
_geometryContext.LineTo(next); |
|
|
|
|
|
_currentPoint = next; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void AddHorizontalLine(ref ReadOnlySpan<char> span, bool relative) |
|
|
private void AddHorizontalLine(ref ReadOnlySpan<char> span, bool relative) |
|
|
{ |
|
|
{ |
|
|
ThrowIfDisposed(); |
|
|
ThrowIfDisposed(); |
|
|
|
|
|
|
|
|
_currentPoint = relative |
|
|
var next = relative |
|
|
? new Point(_currentPoint.X + ReadDouble(ref span), _currentPoint.Y) |
|
|
? new Point(_currentPoint.X + ReadDouble(ref span), _currentPoint.Y) |
|
|
: _currentPoint.WithX(ReadDouble(ref span)); |
|
|
: _currentPoint.WithX(ReadDouble(ref span)); |
|
|
|
|
|
|
|
|
@ -284,14 +285,15 @@ namespace Avalonia.Media |
|
|
CreateFigure(); |
|
|
CreateFigure(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_geometryContext.LineTo(_currentPoint); |
|
|
_geometryContext.LineTo(next); |
|
|
|
|
|
_currentPoint = next; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void AddVerticalLine(ref ReadOnlySpan<char> span, bool relative) |
|
|
private void AddVerticalLine(ref ReadOnlySpan<char> span, bool relative) |
|
|
{ |
|
|
{ |
|
|
ThrowIfDisposed(); |
|
|
ThrowIfDisposed(); |
|
|
|
|
|
|
|
|
_currentPoint = relative |
|
|
var next = relative |
|
|
? new Point(_currentPoint.X, _currentPoint.Y + ReadDouble(ref span)) |
|
|
? new Point(_currentPoint.X, _currentPoint.Y + ReadDouble(ref span)) |
|
|
: _currentPoint.WithY(ReadDouble(ref span)); |
|
|
: _currentPoint.WithY(ReadDouble(ref span)); |
|
|
|
|
|
|
|
|
@ -300,7 +302,8 @@ namespace Avalonia.Media |
|
|
CreateFigure(); |
|
|
CreateFigure(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_geometryContext.LineTo(_currentPoint); |
|
|
_geometryContext.LineTo(next); |
|
|
|
|
|
_currentPoint = next; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void AddCubicBezierCurve(ref ReadOnlySpan<char> span, bool relative) |
|
|
private void AddCubicBezierCurve(ref ReadOnlySpan<char> span, bool relative) |
|
|
|