Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Xamarin.Google.Crypto.Tink.Android from 1.7.0 to 1.7.0.1 #180

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<!-- must be kept in sync with the binding library version to it here: -->
<_XamarinAndroidGlideVersion>4.13.2.2</_XamarinAndroidGlideVersion>
<_XamarinAndroidXSecurityVersion>1.1.0-alpha03</_XamarinAndroidXSecurityVersion>
<_XamarinGoogleCryptoTinkAndroidVersion>1.7.0</_XamarinGoogleCryptoTinkAndroidVersion>
<_XamarinGoogleCryptoTinkAndroidVersion>1.7.0.1</_XamarinGoogleCryptoTinkAndroidVersion>
<!-- Android Maps -->
<XamarinGooglePlayServicesMaps>118.1.0</XamarinGooglePlayServicesMaps>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
#endif
{
internal class BlazorWebViewDeveloperTools
{
public bool Enabled { get; set; } = false;
}
{
public bool Enabled { get; set; } = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollec
#endif
}

/// <summary>
/// Enables Developer tools on the underlying WebView controls.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
{
return services.AddSingleton<BlazorWebViewDeveloperTools>(new BlazorWebViewDeveloperTools { Enabled = true });
}
/// <summary>
/// Enables Developer tools on the underlying WebView controls.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddBlazorWebViewDeveloperTools(this IServiceCollection services)
{
return services.AddSingleton<BlazorWebViewDeveloperTools>(new BlazorWebViewDeveloperTools { Enabled = true });
}
}
}
62 changes: 31 additions & 31 deletions src/Graphics/src/Graphics.Win2D/W2DCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,42 +239,42 @@ public override void DrawString(string value, float x, float y, HorizontalAlignm
try
{
#endif
var textFormat = (CurrentState.Font ?? Graphics.Font.Default).ToCanvasTextFormat(CurrentState.FontSize);
textFormat.VerticalAlignment = CanvasVerticalAlignment.Top;
var textFormat = (CurrentState.Font ?? Graphics.Font.Default).ToCanvasTextFormat(CurrentState.FontSize);
textFormat.VerticalAlignment = CanvasVerticalAlignment.Top;

switch (horizontalAlignment)
{
case HorizontalAlignment.Left:
_rect.X = x;
_rect.Width = CanvasSize.Width;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Left;
break;
case HorizontalAlignment.Right:
_rect.X = x - CanvasSize.Width;
_rect.Width = CanvasSize.Width;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Right;
break;
default:
_rect.X = x - _canvasSize.Width;
_rect.Width = _canvasSize.Width * 2;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Center;
break;
}
switch (horizontalAlignment)
{
case HorizontalAlignment.Left:
_rect.X = x;
_rect.Width = CanvasSize.Width;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Left;
break;
case HorizontalAlignment.Right:
_rect.X = x - CanvasSize.Width;
_rect.Width = CanvasSize.Width;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Right;
break;
default:
_rect.X = x - _canvasSize.Width;
_rect.Width = _canvasSize.Width * 2;
textFormat.HorizontalAlignment = CanvasHorizontalAlignment.Center;
break;
}

_rect.Y = y - CurrentState.FontSize;
_rect.Height = CurrentState.FontSize * 2;
_rect.Y = y - CurrentState.FontSize;
_rect.Height = CurrentState.FontSize * 2;

_point1.X = (float)_rect.X;
_point1.Y = (float)_rect.Y;
_point1.X = (float)_rect.X;
_point1.Y = (float)_rect.Y;

var textLayout = new CanvasTextLayout(
_session,
value,
textFormat,
(float)_rect.Width,
(float)_rect.Height);
var textLayout = new CanvasTextLayout(
_session,
value,
textFormat,
(float)_rect.Width,
(float)_rect.Height);

Draw(ctx => ctx.DrawTextLayout(textLayout, _point1, CurrentState.PlatformFontBrush));
Draw(ctx => ctx.DrawTextLayout(textLayout, _point1, CurrentState.PlatformFontBrush));

#if DEBUG

Expand Down
192 changes: 96 additions & 96 deletions src/Graphics/src/Graphics.Win2D/W2DExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,122 +66,122 @@ public static CanvasGeometry AsPath(this PathF path, float ox, float oy, float f
try
{
#endif
builder.SetFilledRegionDetermination(fillMode);
builder.SetFilledRegionDetermination(fillMode);

var pointIndex = 0;
var arcAngleIndex = 0;
var arcClockwiseIndex = 0;
var figureOpen = false;
var segmentIndex = -1;
var pointIndex = 0;
var arcAngleIndex = 0;
var arcClockwiseIndex = 0;
var figureOpen = false;
var segmentIndex = -1;

var lastOperation = PathOperation.Move;
var lastOperation = PathOperation.Move;

foreach (var type in path.SegmentTypes)
{
segmentIndex++;

if (type == PathOperation.Move)
foreach (var type in path.SegmentTypes)
{
if (lastOperation != PathOperation.Close && lastOperation != PathOperation.Move)
{
builder.EndFigure(CanvasFigureLoop.Open);
}
segmentIndex++;

var point = path[pointIndex++];
var begin = CanvasFigureFill.Default;
builder.BeginFigure(ox + point.X * fx, oy + point.Y * fy, begin);
figureOpen = true;
}
else if (type == PathOperation.Line)
{
var point = path[pointIndex++];
builder.AddLine(ox + point.X * fx, oy + point.Y * fy);
}

else if (type == PathOperation.Quad)
{
var controlPoint = path[pointIndex++];
var endPoint = path[pointIndex++];

builder.AddQuadraticBezier(
new Vector2(ox + controlPoint.X * fx, oy + controlPoint.Y * fy),
new Vector2(ox + endPoint.X * fx, oy + endPoint.Y * fy));
}
else if (type == PathOperation.Cubic)
{
var controlPoint1 = path[pointIndex++];
var controlPoint2 = path[pointIndex++];
var endPoint = path[pointIndex++];
builder.AddCubicBezier(
new Vector2(ox + controlPoint1.X * fx, oy + controlPoint1.Y * fy),
new Vector2(ox + controlPoint2.X * fx, oy + controlPoint2.Y * fy),
new Vector2(ox + endPoint.X * fx, oy + endPoint.Y * fy));
}
else if (type == PathOperation.Arc)
{
var topLeft = path[pointIndex++];
var bottomRight = path[pointIndex++];
var startAngle = path.GetArcAngle(arcAngleIndex++);
var endAngle = path.GetArcAngle(arcAngleIndex++);
var clockwise = path.GetArcClockwise(arcClockwiseIndex++);

while (startAngle < 0)
if (type == PathOperation.Move)
{
startAngle += 360;
}
if (lastOperation != PathOperation.Close && lastOperation != PathOperation.Move)
{
builder.EndFigure(CanvasFigureLoop.Open);
}

while (endAngle < 0)
var point = path[pointIndex++];
var begin = CanvasFigureFill.Default;
builder.BeginFigure(ox + point.X * fx, oy + point.Y * fy, begin);
figureOpen = true;
}
else if (type == PathOperation.Line)
{
endAngle += 360;
var point = path[pointIndex++];
builder.AddLine(ox + point.X * fx, oy + point.Y * fy);
}

var rotation = GeometryUtil.GetSweep(startAngle, endAngle, clockwise);
var absRotation = Math.Abs(rotation);

var rectX = ox + topLeft.X * fx;
var rectY = oy + topLeft.Y * fy;
var rectWidth = (ox + bottomRight.X * fx) - rectX;
var rectHeight = (oy + bottomRight.Y * fy) - rectY;

var startPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -startAngle);
var endPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -endAngle);

else if (type == PathOperation.Quad)
{
var controlPoint = path[pointIndex++];
var endPoint = path[pointIndex++];

if (!figureOpen)
builder.AddQuadraticBezier(
new Vector2(ox + controlPoint.X * fx, oy + controlPoint.Y * fy),
new Vector2(ox + endPoint.X * fx, oy + endPoint.Y * fy));
}
else if (type == PathOperation.Cubic)
{
var begin = CanvasFigureFill.Default;
builder.BeginFigure(startPoint.X, startPoint.Y, begin);
figureOpen = true;
var controlPoint1 = path[pointIndex++];
var controlPoint2 = path[pointIndex++];
var endPoint = path[pointIndex++];
builder.AddCubicBezier(
new Vector2(ox + controlPoint1.X * fx, oy + controlPoint1.Y * fy),
new Vector2(ox + controlPoint2.X * fx, oy + controlPoint2.Y * fy),
new Vector2(ox + endPoint.X * fx, oy + endPoint.Y * fy));
}
else if (type == PathOperation.Arc)
{
var topLeft = path[pointIndex++];
var bottomRight = path[pointIndex++];
var startAngle = path.GetArcAngle(arcAngleIndex++);
var endAngle = path.GetArcAngle(arcAngleIndex++);
var clockwise = path.GetArcClockwise(arcClockwiseIndex++);

while (startAngle < 0)
{
startAngle += 360;
}

while (endAngle < 0)
{
endAngle += 360;
}

var rotation = GeometryUtil.GetSweep(startAngle, endAngle, clockwise);
var absRotation = Math.Abs(rotation);

var rectX = ox + topLeft.X * fx;
var rectY = oy + topLeft.Y * fy;
var rectWidth = (ox + bottomRight.X * fx) - rectX;
var rectHeight = (oy + bottomRight.Y * fy) - rectY;

var startPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -startAngle);
var endPoint = GeometryUtil.EllipseAngleToPoint(rectX, rectY, rectWidth, rectHeight, -endAngle);


if (!figureOpen)
{
var begin = CanvasFigureFill.Default;
builder.BeginFigure(startPoint.X, startPoint.Y, begin);
figureOpen = true;
}
else
{
builder.AddLine(startPoint.X, startPoint.Y);
}

builder.AddArc(
new Vector2(endPoint.X, endPoint.Y),
rectWidth / 2,
rectHeight / 2,
0,
clockwise ? CanvasSweepDirection.Clockwise : CanvasSweepDirection.CounterClockwise,
absRotation >= 180 ? CanvasArcSize.Large : CanvasArcSize.Small
);
}
else
else if (type == PathOperation.Close)
{
builder.AddLine(startPoint.X, startPoint.Y);
builder.EndFigure(CanvasFigureLoop.Closed);
}

builder.AddArc(
new Vector2(endPoint.X, endPoint.Y),
rectWidth / 2,
rectHeight / 2,
0,
clockwise ? CanvasSweepDirection.Clockwise : CanvasSweepDirection.CounterClockwise,
absRotation >= 180 ? CanvasArcSize.Large : CanvasArcSize.Small
);
lastOperation = type;
}
else if (type == PathOperation.Close)

if (segmentIndex >= 0 && lastOperation != PathOperation.Close)
{
builder.EndFigure(CanvasFigureLoop.Closed);
builder.EndFigure(CanvasFigureLoop.Open);
}

lastOperation = type;
}

if (segmentIndex >= 0 && lastOperation != PathOperation.Close)
{
builder.EndFigure(CanvasFigureLoop.Open);
}

var geometry = CanvasGeometry.CreatePath(builder);
return geometry;
var geometry = CanvasGeometry.CreatePath(builder);
return geometry;
#if DEBUG
}
catch (Exception exc)
Expand Down