Skip to content

Commit

Permalink
Update MAUI Graphics (#5552)
Browse files Browse the repository at this point in the history
* 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 <javiersuarezruiz@hotmail.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
  • Loading branch information
4 people authored Mar 28, 2022
1 parent 6860dc7 commit f2cdd2d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,9 @@
<Uri>https://github.com/dotnet/templating</Uri>
<Sha>3f4da9ced34942d83054e647f3b1d9d7dde281e8</Sha>
</Dependency>
<Dependency Name="Microsoft.Maui.Graphics" Version="6.0.300-rc.1.1184">
<Uri>https://github.com/dotnet/Microsoft.Maui.Graphics</Uri>
<Sha>78fafb45ff1f771e1910411eacc29d0342e891c5</Sha>
</Dependency>
</ProductDependencies>
</Dependencies>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<MicrosoftWindowsDesktopAppRuntimewinx64Version>6.0.2</MicrosoftWindowsDesktopAppRuntimewinx64Version>
<!-- Other packages -->
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<MicrosoftMauiGraphicsVersion>6.0.200-preview.14.1092</MicrosoftMauiGraphicsVersion>
<MicrosoftMauiGraphicsVersion>6.0.300-rc.1.1184</MicrosoftMauiGraphicsVersion>
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
<_MicrosoftWebWebView2Version>1.0.1020.30</_MicrosoftWebWebView2Version>
<!-- GLIDE - the android maven artifact in /src/Core/AndroidNative/maui/build.gradle -->
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/HandlerImpl/Brush.Impl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.Maui.Graphics;
using GraphicsGradientStop = Microsoft.Maui.Graphics.GradientStop;
using GraphicsGradientStop = Microsoft.Maui.Graphics.PaintGradientStop;

namespace Microsoft.Maui.Controls
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Graphics/PaintExtensions.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static partial class PaintExtensions
throw new NotImplementedException();
}

static void AddRange(this IList<WGradientStop> nativeStops, IEnumerable<GradientStop> stops)
static void AddRange(this IList<WGradientStop> nativeStops, IEnumerable<PaintGradientStop> stops)
{
foreach (var stop in stops.OrderBy(x => x.Offset))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Graphics/PaintExtensions.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static CGPoint GetRadialGradientPaintEndPoint(Point startPoint, double radius)
return new CGPoint(x, y);
}

static NSNumber[] GetCAGradientLayerLocations(List<GradientStop> gradientStops)
static NSNumber[] GetCAGradientLayerLocations(List<PaintGradientStop> gradientStops)
{
if (gradientStops == null || gradientStops.Count == 0)
return new NSNumber[0];
Expand Down
6 changes: 3 additions & 3 deletions src/Core/src/Platform/Windows/GraphicsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ 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;
var rectY = topLeft.Y * scale;
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)
{
Expand Down

0 comments on commit f2cdd2d

Please sign in to comment.