Browse Source
Merge pull request #6505 from workgroupengineering/fixes/Visual_Warnings
fixes(Visuals): Suppress warning CS0618 'IVisualWithRoundRectClip' i…
pull/6675/head
Max Katz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
3 deletions
-
src/Avalonia.Visuals/Rendering/ImmediateRenderer.cs
-
src/Avalonia.Visuals/Rendering/SceneGraph/SceneBuilder.cs
|
|
|
@ -289,11 +289,14 @@ namespace Avalonia.Rendering |
|
|
|
|
|
|
|
using (context.PushPostTransform(m)) |
|
|
|
using (context.PushOpacity(opacity)) |
|
|
|
using (clipToBounds |
|
|
|
? visual is IVisualWithRoundRectClip roundClipVisual |
|
|
|
using (clipToBounds |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
? visual is IVisualWithRoundRectClip roundClipVisual |
|
|
|
? context.PushClip(new RoundedRect(bounds, roundClipVisual.ClipToBoundsRadius)) |
|
|
|
: context.PushClip(bounds) |
|
|
|
: default(DrawingContext.PushedState)) |
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
|
|
|
|
using (visual.Clip != null ? context.PushGeometryClip(visual.Clip) : default(DrawingContext.PushedState)) |
|
|
|
using (visual.OpacityMask != null ? context.PushOpacityMask(visual.OpacityMask, bounds) : default(DrawingContext.PushedState)) |
|
|
|
using (context.PushTransformContainer()) |
|
|
|
|
|
|
|
@ -164,10 +164,12 @@ namespace Avalonia.Rendering.SceneGraph |
|
|
|
var visual = node.Visual; |
|
|
|
var opacity = visual.Opacity; |
|
|
|
var clipToBounds = visual.ClipToBounds; |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
var clipToBoundsRadius = visual is IVisualWithRoundRectClip roundRectClip ? |
|
|
|
roundRectClip.ClipToBoundsRadius : |
|
|
|
default; |
|
|
|
|
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
|
|
|
|
var bounds = new Rect(visual.Bounds.Size); |
|
|
|
var contextImpl = (DeferredDrawingContextImpl)context.PlatformImpl; |
|
|
|
|
|
|
|
|