From f2cdd2dd28769bb709190d674bfdbd65c3035dcc Mon Sep 17 00:00:00 2001 From: Jonathan Dick Date: Mon, 28 Mar 2022 14:02:22 -0400 Subject: [PATCH] Update MAUI Graphics (#5552) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update MAUI Graphics * Fix build errors (changes in graphics classes naming) * Fix build errors * [maestro] Add Microsoft Maui Graphics bumps vias maestro * [ci] Bump graphics * Fix usage of old GradientStop Co-authored-by: Javier Suárez Ruiz Co-authored-by: Matthew Leibowitz Co-authored-by: Rui Marinho --- eng/Version.Details.xml | 4 ++++ eng/Versions.props | 2 +- src/Controls/src/Core/HandlerImpl/Brush.Impl.cs | 2 +- src/Core/src/Graphics/PaintExtensions.Windows.cs | 2 +- src/Core/src/Graphics/PaintExtensions.iOS.cs | 2 +- src/Core/src/Platform/Windows/GraphicsExtensions.cs | 6 +++--- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6e50aad0dc95..803754035e5a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -79,5 +79,9 @@ https://github.com/dotnet/templating 3f4da9ced34942d83054e647f3b1d9d7dde281e8 + + https://github.com/dotnet/Microsoft.Maui.Graphics + 78fafb45ff1f771e1910411eacc29d0342e891c5 + diff --git a/eng/Versions.props b/eng/Versions.props index fa1f218eeba2..9be3d7395401 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -34,7 +34,7 @@ 6.0.2 3.3.3 - 6.0.200-preview.14.1092 + 6.0.300-rc.1.1184 4.5.0 <_MicrosoftWebWebView2Version>1.0.1020.30 diff --git a/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs b/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs index 3e925472eb33..d4f0a4b4bdcc 100644 --- a/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs +++ b/src/Controls/src/Core/HandlerImpl/Brush.Impl.cs @@ -1,5 +1,5 @@ using Microsoft.Maui.Graphics; -using GraphicsGradientStop = Microsoft.Maui.Graphics.GradientStop; +using GraphicsGradientStop = Microsoft.Maui.Graphics.PaintGradientStop; namespace Microsoft.Maui.Controls { diff --git a/src/Core/src/Graphics/PaintExtensions.Windows.cs b/src/Core/src/Graphics/PaintExtensions.Windows.cs index e491e7fa578a..e182d4618e0f 100644 --- a/src/Core/src/Graphics/PaintExtensions.Windows.cs +++ b/src/Core/src/Graphics/PaintExtensions.Windows.cs @@ -79,7 +79,7 @@ public static partial class PaintExtensions throw new NotImplementedException(); } - static void AddRange(this IList nativeStops, IEnumerable stops) + static void AddRange(this IList nativeStops, IEnumerable stops) { foreach (var stop in stops.OrderBy(x => x.Offset)) { diff --git a/src/Core/src/Graphics/PaintExtensions.iOS.cs b/src/Core/src/Graphics/PaintExtensions.iOS.cs index 5a441a0f0fc2..e6f67abc385c 100644 --- a/src/Core/src/Graphics/PaintExtensions.iOS.cs +++ b/src/Core/src/Graphics/PaintExtensions.iOS.cs @@ -132,7 +132,7 @@ static CGPoint GetRadialGradientPaintEndPoint(Point startPoint, double radius) return new CGPoint(x, y); } - static NSNumber[] GetCAGradientLayerLocations(List gradientStops) + static NSNumber[] GetCAGradientLayerLocations(List gradientStops) { if (gradientStops == null || gradientStops.Count == 0) return new NSNumber[0]; diff --git a/src/Core/src/Platform/Windows/GraphicsExtensions.cs b/src/Core/src/Platform/Windows/GraphicsExtensions.cs index 205eb73cdb3a..3fc4b0002a38 100644 --- a/src/Core/src/Platform/Windows/GraphicsExtensions.cs +++ b/src/Core/src/Platform/Windows/GraphicsExtensions.cs @@ -66,7 +66,7 @@ public static PathGeometry AsPathGeometry(this PathF target, float scale = 1) endAngle += 360; } - var sweep = Graphics.Geometry.GetSweep(startAngle, endAngle, clockwise); + var sweep = GeometryUtil.GetSweep(startAngle, endAngle, clockwise); var absSweep = Math.Abs(sweep); var rectX = topLeft.X * scale; @@ -74,8 +74,8 @@ public static PathGeometry AsPathGeometry(this PathF target, float scale = 1) var rectWidth = bottomRight.X * scale - topLeft.X * scale; var rectHeight = bottomRight.Y * scale - topLeft.Y * scale; - var startPoint = Graphics.Geometry.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -startAngle); - var endPoint = Graphics.Geometry.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -endAngle); + var startPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -startAngle); + var endPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -endAngle); if (figure == null) {