Browse Source
Merge pull request #6461 from Gillibald/fixes/OpacityMask
Prevent DeferredRenderer crash when a VisualBrush is used as OpacityMask
pull/6648/head
Benedikt Stebner
5 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/Avalonia.Visuals/Rendering/DeferredRenderer.cs
|
|
|
@ -279,13 +279,13 @@ namespace Avalonia.Rendering |
|
|
|
/// <inheritdoc/>
|
|
|
|
Size IVisualBrushRenderer.GetRenderTargetSize(IVisualBrush brush) |
|
|
|
{ |
|
|
|
return (_currentDraw.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]?.Size ?? Size.Empty; |
|
|
|
return (_currentDraw?.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]?.Size ?? Size.Empty; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
void IVisualBrushRenderer.RenderVisualBrush(IDrawingContextImpl context, IVisualBrush brush) |
|
|
|
{ |
|
|
|
var childScene = (_currentDraw.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]; |
|
|
|
var childScene = (_currentDraw?.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]; |
|
|
|
|
|
|
|
if (childScene != null) |
|
|
|
{ |
|
|
|
|