Browse Source
Merge pull request #1485 from AvaloniaUI/fixes/geometryimpl-nre
Allow null pen in GeometryImpl.
pull/1491/head
Steven Kirk
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs
|
|
|
@ -24,7 +24,7 @@ namespace Avalonia.Direct2D1.Media |
|
|
|
/// <inheritdoc/>
|
|
|
|
public Rect GetRenderBounds(Avalonia.Media.Pen pen) |
|
|
|
{ |
|
|
|
return Geometry.GetWidenedBounds((float) (pen?.Thickness ?? 0)).ToAvalonia(); |
|
|
|
return Geometry.GetWidenedBounds((float)(pen?.Thickness ?? 0)).ToAvalonia(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
@ -48,7 +48,7 @@ namespace Avalonia.Direct2D1.Media |
|
|
|
/// <inheritdoc/>
|
|
|
|
public bool StrokeContains(Avalonia.Media.Pen pen, Point point) |
|
|
|
{ |
|
|
|
return Geometry.StrokeContainsPoint(point.ToSharpDX(), (float)pen.Thickness); |
|
|
|
return Geometry.StrokeContainsPoint(point.ToSharpDX(), (float)(pen?.Thickness ?? 0)); |
|
|
|
} |
|
|
|
|
|
|
|
public ITransformedGeometryImpl WithTransform(Matrix transform) |
|
|
|
|