Browse Source

Merge master into fixes/Warnings/Null-Annotation

pull/8193/head
Giuseppe Lippolis 4 years ago
parent
commit
e7875df625
  1. 3
      samples/ControlCatalog/ControlCatalog.csproj
  2. 3
      samples/ControlCatalog/Pages/DialogsPage.xaml.cs
  3. 6
      src/Avalonia.Base/Animation/Animators/GradientBrushAnimator.cs
  4. 1
      src/Avalonia.Base/Animation/Transitions/Rotate3DTransition.cs
  5. 2
      src/Avalonia.Base/AvaloniaPropertyChangedEventArgs.cs
  6. 15
      src/Avalonia.Base/Media/Brush.cs
  7. 5
      src/Avalonia.Base/Media/IBrush.cs
  8. 4
      src/Avalonia.Base/Media/Immutable/ImmutableConicGradientBrush.cs
  9. 11
      src/Avalonia.Base/Media/Immutable/ImmutableGradientBrush.cs
  10. 3
      src/Avalonia.Base/Media/Immutable/ImmutableImageBrush.cs
  11. 4
      src/Avalonia.Base/Media/Immutable/ImmutableLinearGradientBrush.cs
  12. 4
      src/Avalonia.Base/Media/Immutable/ImmutableRadialGradientBrush.cs
  13. 5
      src/Avalonia.Base/Media/Immutable/ImmutableSolidColorBrush.cs
  14. 9
      src/Avalonia.Base/Media/Immutable/ImmutableTileBrush.cs
  15. 3
      src/Avalonia.Base/Media/Immutable/ImmutableVisualBrush.cs
  16. 3
      src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs
  17. 2
      src/Avalonia.Controls/SystemDialog.cs
  18. 4
      src/Avalonia.Native/SystemDialogs.cs
  19. 39
      src/Skia/Avalonia.Skia/DrawingContextImpl.cs

3
samples/ControlCatalog/ControlCatalog.csproj

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">

3
samples/ControlCatalog/Pages/DialogsPage.xaml.cs

@ -8,7 +8,6 @@ using Avalonia.Dialogs;
using Avalonia.Layout;
using Avalonia.Markup.Xaml;
#pragma warning disable 4014
namespace ControlCatalog.Pages
{
public class DialogsPage : UserControl
@ -22,7 +21,7 @@ namespace ControlCatalog.Pages
string lastSelectedDirectory = null;
List<FileDialogFilter> GetFilters()
List<FileDialogFilter>? GetFilters()
{
if (this.FindControl<CheckBox>("UseFilters").IsChecked != true)
return null;

6
src/Avalonia.Base/Animation/Animators/GradientBrushAnimator.cs

@ -31,6 +31,7 @@ namespace Avalonia.Animation.Animators
InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops),
s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity),
oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null,
s_relativePointAnimator.Interpolate(progress, oldValue.TransformOrigin, newValue.TransformOrigin),
oldValue.SpreadMethod,
s_relativePointAnimator.Interpolate(progress, oldRadial.Center, newRadial.Center),
s_relativePointAnimator.Interpolate(progress, oldRadial.GradientOrigin, newRadial.GradientOrigin),
@ -41,6 +42,7 @@ namespace Avalonia.Animation.Animators
InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops),
s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity),
oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null,
s_relativePointAnimator.Interpolate(progress, oldValue.TransformOrigin, newValue.TransformOrigin),
oldValue.SpreadMethod,
s_relativePointAnimator.Interpolate(progress, oldConic.Center, newConic.Center),
s_doubleAnimator.Interpolate(progress, oldConic.Angle, newConic.Angle));
@ -50,6 +52,7 @@ namespace Avalonia.Animation.Animators
InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops),
s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity),
oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null,
s_relativePointAnimator.Interpolate(progress, oldValue.TransformOrigin, newValue.TransformOrigin),
oldValue.SpreadMethod,
s_relativePointAnimator.Interpolate(progress, oldLinear.StartPoint, newLinear.StartPoint),
s_relativePointAnimator.Interpolate(progress, oldLinear.EndPoint, newLinear.EndPoint));
@ -102,18 +105,21 @@ namespace Avalonia.Animation.Animators
return new ImmutableRadialGradientBrush(
CreateStopsFromSolidColorBrush(solidColorBrush, oldRadial.GradientStops), solidColorBrush.Opacity,
oldRadial.Transform is { } ? new ImmutableTransform(oldRadial.Transform.Value) : null,
oldRadial.TransformOrigin,
oldRadial.SpreadMethod, oldRadial.Center, oldRadial.GradientOrigin, oldRadial.Radius);
case IConicGradientBrush oldConic:
return new ImmutableConicGradientBrush(
CreateStopsFromSolidColorBrush(solidColorBrush, oldConic.GradientStops), solidColorBrush.Opacity,
oldConic.Transform is { } ? new ImmutableTransform(oldConic.Transform.Value) : null,
oldConic.TransformOrigin,
oldConic.SpreadMethod, oldConic.Center, oldConic.Angle);
case ILinearGradientBrush oldLinear:
return new ImmutableLinearGradientBrush(
CreateStopsFromSolidColorBrush(solidColorBrush, oldLinear.GradientStops), solidColorBrush.Opacity,
oldLinear.Transform is { } ? new ImmutableTransform(oldLinear.Transform.Value) : null,
oldLinear.TransformOrigin,
oldLinear.SpreadMethod, oldLinear.StartPoint, oldLinear.EndPoint);
default:

1
src/Avalonia.Base/Animation/Transitions/Rotate3DTransition.cs

@ -14,6 +14,7 @@ public class Rotate3DTransition: PageSlide
/// </summary>
/// <param name="duration">How long the rotation should take place</param>
/// <param name="orientation">The orientation of the rotation</param>
/// <param name="depth">Defines the depth of the 3D Effect. If null, depth will be calculated automatically from the width or height of the common parent of the visual being rotated</param>
public Rotate3DTransition(TimeSpan duration, SlideAxis orientation = SlideAxis.Horizontal, double? depth = null)
: base(duration, orientation)
{

2
src/Avalonia.Base/AvaloniaPropertyChangedEventArgs.cs

@ -55,7 +55,7 @@ namespace Avalonia
/// </summary>
/// <remarks>
/// This will usually be true, except in
/// <see cref="AvaloniaObject.OnPropertyChangedCore{T}(AvaloniaPropertyChangedEventArgs{T})"/>
/// <see cref="AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)"/>
/// which receives notifications for all changes to property values, whether a value with a higher
/// priority is present or not. When this property is false, the change that is being signaled
/// has not resulted in a change to the property value on the object.

15
src/Avalonia.Base/Media/Brush.cs

@ -24,6 +24,12 @@ namespace Avalonia.Media
public static readonly StyledProperty<ITransform?> TransformProperty =
AvaloniaProperty.Register<Brush, ITransform?>(nameof(Transform));
/// <summary>
/// Defines the <see cref="TransformOrigin"/> property
/// </summary>
public static readonly StyledProperty<RelativePoint> TransformOriginProperty =
AvaloniaProperty.Register<Brush, RelativePoint>(nameof(TransformOrigin));
/// <inheritdoc/>
public event EventHandler? Invalidated;
@ -51,6 +57,15 @@ namespace Avalonia.Media
set { SetValue(TransformProperty, value); }
}
/// <summary>
/// Gets or sets the origin of the brush <see cref="Transform"/>
/// </summary>
public RelativePoint TransformOrigin
{
get => GetValue(TransformOriginProperty);
set => SetValue(TransformOriginProperty, value);
}
/// <summary>
/// Parses a brush string.
/// </summary>

5
src/Avalonia.Base/Media/IBrush.cs

@ -19,5 +19,10 @@ namespace Avalonia.Media
/// Gets the transform of the brush.
/// </summary>
ITransform? Transform { get; }
/// <summary>
/// Gets the origin of the brushes <see cref="Transform"/>
/// </summary>
RelativePoint TransformOrigin { get; }
}
}

4
src/Avalonia.Base/Media/Immutable/ImmutableConicGradientBrush.cs

@ -13,6 +13,7 @@ namespace Avalonia.Media.Immutable
/// <param name="gradientStops">The gradient stops.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="spreadMethod">The spread method.</param>
/// <param name="center">The center point for the gradient.</param>
/// <param name="angle">The starting angle for the gradient.</param>
@ -20,10 +21,11 @@ namespace Avalonia.Media.Immutable
IReadOnlyList<ImmutableGradientStop> gradientStops,
double opacity = 1,
ImmutableTransform? transform = null,
RelativePoint? transformOrigin = null,
GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
RelativePoint? center = null,
double angle = 0)
: base(gradientStops, opacity, transform, spreadMethod)
: base(gradientStops, opacity, transform, transformOrigin, spreadMethod)
{
Center = center ?? RelativePoint.Center;
Angle = angle;

11
src/Avalonia.Base/Media/Immutable/ImmutableGradientBrush.cs

@ -13,16 +13,19 @@ namespace Avalonia.Media.Immutable
/// <param name="gradientStops">The gradient stops.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="spreadMethod">The spread method.</param>
protected ImmutableGradientBrush(
IReadOnlyList<ImmutableGradientStop> gradientStops,
double opacity,
ImmutableTransform? transform,
RelativePoint? transformOrigin,
GradientSpreadMethod spreadMethod)
{
GradientStops = gradientStops;
Opacity = opacity;
Transform = transform;
TransformOrigin = transformOrigin.HasValue ? transformOrigin.Value : RelativePoint.TopLeft;
SpreadMethod = spreadMethod;
}
@ -31,7 +34,8 @@ namespace Avalonia.Media.Immutable
/// </summary>
/// <param name="source">The brush from which this brush's properties should be copied.</param>
protected ImmutableGradientBrush(GradientBrush source)
: this(source.GradientStops.ToImmutable(), source.Opacity, source.Transform?.ToImmutable(), source.SpreadMethod)
: this(source.GradientStops.ToImmutable(), source.Opacity, source.Transform?.ToImmutable(),
source.TransformOrigin, source.SpreadMethod)
{
}
@ -47,6 +51,11 @@ namespace Avalonia.Media.Immutable
/// </summary>
public ITransform? Transform { get; }
/// <summary>
/// Gets the transform origin of the brush
/// </summary>
public RelativePoint TransformOrigin { get; }
/// <inheritdoc/>
public GradientSpreadMethod SpreadMethod { get; }
}

3
src/Avalonia.Base/Media/Immutable/ImmutableImageBrush.cs

@ -16,6 +16,7 @@ namespace Avalonia.Media.Immutable
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
/// <param name="stretch">
/// How the source rectangle will be stretched to fill the destination rect.
@ -29,6 +30,7 @@ namespace Avalonia.Media.Immutable
RelativeRect? destinationRect = null,
double opacity = 1,
ImmutableTransform? transform = null,
RelativePoint transformOrigin = new RelativePoint(),
RelativeRect? sourceRect = null,
Stretch stretch = Stretch.Uniform,
TileMode tileMode = TileMode.None,
@ -39,6 +41,7 @@ namespace Avalonia.Media.Immutable
destinationRect ?? RelativeRect.Fill,
opacity,
transform,
transformOrigin,
sourceRect ?? RelativeRect.Fill,
stretch,
tileMode,

4
src/Avalonia.Base/Media/Immutable/ImmutableLinearGradientBrush.cs

@ -13,6 +13,7 @@ namespace Avalonia.Media.Immutable
/// <param name="gradientStops">The gradient stops.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="spreadMethod">The spread method.</param>
/// <param name="startPoint">The start point for the gradient.</param>
/// <param name="endPoint">The end point for the gradient.</param>
@ -20,10 +21,11 @@ namespace Avalonia.Media.Immutable
IReadOnlyList<ImmutableGradientStop> gradientStops,
double opacity = 1,
ImmutableTransform? transform = null,
RelativePoint? transformOrigin = null,
GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
RelativePoint? startPoint = null,
RelativePoint? endPoint = null)
: base(gradientStops, opacity, transform, spreadMethod)
: base(gradientStops, opacity, transform, transformOrigin, spreadMethod)
{
StartPoint = startPoint ?? RelativePoint.TopLeft;
EndPoint = endPoint ?? RelativePoint.BottomRight;

4
src/Avalonia.Base/Media/Immutable/ImmutableRadialGradientBrush.cs

@ -13,6 +13,7 @@ namespace Avalonia.Media.Immutable
/// <param name="gradientStops">The gradient stops.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="spreadMethod">The spread method.</param>
/// <param name="center">The start point for the gradient.</param>
/// <param name="gradientOrigin">
@ -25,11 +26,12 @@ namespace Avalonia.Media.Immutable
IReadOnlyList<ImmutableGradientStop> gradientStops,
double opacity = 1,
ImmutableTransform? transform = null,
RelativePoint? transformOrigin = null,
GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
RelativePoint? center = null,
RelativePoint? gradientOrigin = null,
double radius = 0.5)
: base(gradientStops, opacity, transform, spreadMethod)
: base(gradientStops, opacity, transform, transformOrigin, spreadMethod)
{
Center = center ?? RelativePoint.Center;
GradientOrigin = gradientOrigin ?? RelativePoint.Center;

5
src/Avalonia.Base/Media/Immutable/ImmutableSolidColorBrush.cs

@ -53,6 +53,11 @@ namespace Avalonia.Media.Immutable
/// </summary>
public ITransform? Transform { get; }
/// <summary>
/// Gets the transform origin of the brush
/// </summary>
public RelativePoint TransformOrigin { get; }
public bool Equals(ImmutableSolidColorBrush? other)
{
if (ReferenceEquals(null, other)) return false;

9
src/Avalonia.Base/Media/Immutable/ImmutableTileBrush.cs

@ -15,6 +15,7 @@ namespace Avalonia.Media.Immutable
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
/// <param name="stretch">
/// How the source rectangle will be stretched to fill the destination rect.
@ -27,6 +28,7 @@ namespace Avalonia.Media.Immutable
RelativeRect destinationRect,
double opacity,
ImmutableTransform? transform,
RelativePoint transformOrigin,
RelativeRect sourceRect,
Stretch stretch,
TileMode tileMode,
@ -37,6 +39,7 @@ namespace Avalonia.Media.Immutable
DestinationRect = destinationRect;
Opacity = opacity;
Transform = transform;
TransformOrigin = transformOrigin;
SourceRect = sourceRect;
Stretch = stretch;
TileMode = tileMode;
@ -54,6 +57,7 @@ namespace Avalonia.Media.Immutable
source.DestinationRect,
source.Opacity,
source.Transform?.ToImmutable(),
source.TransformOrigin,
source.SourceRect,
source.Stretch,
source.TileMode,
@ -78,6 +82,11 @@ namespace Avalonia.Media.Immutable
/// </summary>
public ITransform? Transform { get; }
/// <summary>
/// Gets the transform origin of the brush
/// </summary>
public RelativePoint TransformOrigin { get; }
/// <inheritdoc/>
public RelativeRect SourceRect { get; }

3
src/Avalonia.Base/Media/Immutable/ImmutableVisualBrush.cs

@ -17,6 +17,7 @@ namespace Avalonia.Media.Immutable
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
/// <param name="opacity">The opacity of the brush.</param>
/// <param name="transform">The transform of the brush.</param>
/// <param name="transformOrigin">The transform origin of the brush</param>
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
/// <param name="stretch">
/// How the source rectangle will be stretched to fill the destination rect.
@ -30,6 +31,7 @@ namespace Avalonia.Media.Immutable
RelativeRect? destinationRect = null,
double opacity = 1,
ImmutableTransform? transform = null,
RelativePoint transformOrigin = new RelativePoint(),
RelativeRect? sourceRect = null,
Stretch stretch = Stretch.Uniform,
TileMode tileMode = TileMode.None,
@ -40,6 +42,7 @@ namespace Avalonia.Media.Immutable
destinationRect ?? RelativeRect.Fill,
opacity,
transform,
transformOrigin,
sourceRect ?? RelativeRect.Fill,
stretch,
tileMode,

3
src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs

@ -193,8 +193,11 @@ namespace Avalonia.Controls
}
}
/// <summary>Try get number of DataSource itmes.</summary>
/// <param name="allowSlow">When "allowSlow" is false, method will not use Linq.Count() method and will return 0 or 1 instead.</param>
/// <param name="getAny">If "getAny" is true, method can use Linq.Any() method to speedup.</param>
/// <param name="count">number of DataSource itmes.</param>
/// <returns>true if able to retrieve number of DataSource itmes; otherwise, false.</returns>
internal bool TryGetCount(bool allowSlow, bool getAny, out int count)
{
bool result;

2
src/Avalonia.Controls/SystemDialog.cs

@ -15,7 +15,7 @@ namespace Avalonia.Controls
/// Gets or sets a collection of filters which determine the types of files displayed in an
/// <see cref="OpenFileDialog"/> or an <see cref="SaveFileDialog"/>.
/// </summary>
public List<FileDialogFilter> Filters { get; set; } = new List<FileDialogFilter>();
public List<FileDialogFilter>? Filters { get; set; } = new List<FileDialogFilter>();
/// <summary>
/// Gets or sets initial file name that is displayed when the dialog is opened.

4
src/Avalonia.Native/SystemDialogs.cs

@ -30,7 +30,7 @@ namespace Avalonia.Native
ofd.Title ?? "",
ofd.Directory ?? "",
ofd.InitialFileName ?? "",
string.Join(";", dialog.Filters.SelectMany(f => f.Extensions)));
string.Join(";", dialog.Filters?.SelectMany(f => f.Extensions) ?? Array.Empty<string>()));
}
else
{
@ -39,7 +39,7 @@ namespace Avalonia.Native
dialog.Title ?? "",
dialog.Directory ?? "",
dialog.InitialFileName ?? "",
string.Join(";", dialog.Filters.SelectMany(f => f.Extensions)));
string.Join(";", dialog.Filters?.SelectMany(f => f.Extensions) ?? Array.Empty<string>()));
}
return events.Task.ContinueWith(t => { events.Dispose(); return t.Result; });

39
src/Skia/Avalonia.Skia/DrawingContextImpl.cs

@ -181,7 +181,8 @@ namespace Avalonia.Skia
var size = geometry.Bounds.Size;
using (var fill = brush != null ? CreatePaint(_fillPaint, brush, size) : default(PaintWrapper))
using (var stroke = pen?.Brush != null ? CreatePaint(_strokePaint, pen, size) : default(PaintWrapper))
using (var stroke = pen?.Brush != null ? CreatePaint(_strokePaint, pen,
size.Inflate(new Thickness(pen?.Thickness / 2 ?? 0))) : default(PaintWrapper))
{
if (fill.Paint != null)
{
@ -398,7 +399,7 @@ namespace Avalonia.Skia
if (pen?.Brush != null)
{
using (var paint = CreatePaint(_strokePaint, pen, rect.Rect.Size))
using (var paint = CreatePaint(_strokePaint, pen, rect.Rect.Size.Inflate(new Thickness(pen?.Thickness / 2 ?? 0))))
{
if (paint.Paint is object)
{
@ -433,7 +434,7 @@ namespace Avalonia.Skia
if (pen?.Brush != null)
{
using (var paint = CreatePaint(_strokePaint, pen, rect.Size))
using (var paint = CreatePaint(_strokePaint, pen, rect.Size.Inflate(new Thickness(pen?.Thickness / 2 ?? 0))))
{
if (paint.Paint is object)
{
@ -625,8 +626,12 @@ namespace Avalonia.Skia
}
else
{
var transformOrigin = linearGradient.TransformOrigin.ToPixels(targetSize);
var offset = Matrix.CreateTranslation(transformOrigin);
var transform = (-offset) * linearGradient.Transform.Value * (offset);
using (var shader =
SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode, linearGradient.Transform.Value.ToSKMatrix()))
SKShader.CreateLinearGradient(start, end, stopColors, stopOffsets, tileMode, transform.ToSKMatrix()))
{
paintWrapper.Paint.Shader = shader;
}
@ -654,8 +659,12 @@ namespace Avalonia.Skia
}
else
{
var transformOrigin = radialGradient.TransformOrigin.ToPixels(targetSize);
var offset = Matrix.CreateTranslation(transformOrigin);
var transform = (-offset) * radialGradient.Transform.Value * (offset);
using (var shader =
SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode, radialGradient.Transform.Value.ToSKMatrix()))
SKShader.CreateRadialGradient(center, radius, stopColors, stopOffsets, tileMode, transform.ToSKMatrix()))
{
paintWrapper.Paint.Shader = shader;
}
@ -694,9 +703,14 @@ namespace Avalonia.Skia
}
else
{
var transformOrigin = radialGradient.TransformOrigin.ToPixels(targetSize);
var offset = Matrix.CreateTranslation(transformOrigin);
var transform = (-offset) * radialGradient.Transform.Value * (offset);
using (var shader = SKShader.CreateCompose(
SKShader.CreateColor(reversedColors[0]),
SKShader.CreateTwoPointConicalGradient(center, radius, origin, 0, reversedColors, reversedStops, tileMode, radialGradient.Transform.Value.ToSKMatrix())
SKShader.CreateTwoPointConicalGradient(center, radius, origin, 0, reversedColors, reversedStops, tileMode, transform.ToSKMatrix())
))
{
paintWrapper.Paint.Shader = shader;
@ -717,7 +731,12 @@ namespace Avalonia.Skia
if (conicGradient.Transform is { })
{
rotation = rotation.PreConcat(conicGradient.Transform.Value.ToSKMatrix());
var transformOrigin = conicGradient.TransformOrigin.ToPixels(targetSize);
var offset = Matrix.CreateTranslation(transformOrigin);
var transform = (-offset) * conicGradient.Transform.Value * (offset);
rotation = rotation.PreConcat(transform.ToSKMatrix());
}
using (var shader =
@ -794,7 +813,11 @@ namespace Avalonia.Skia
if (tileBrush.Transform is { })
{
paintTransform = paintTransform.PreConcat(tileBrush.Transform.Value.ToSKMatrix());
var origin = tileBrush.TransformOrigin.ToPixels(targetSize);
var offset = Matrix.CreateTranslation(origin);
var transform = (-offset) * tileBrush.Transform.Value * (offset);
paintTransform = paintTransform.PreConcat(transform.ToSKMatrix());
}
using (var shader = image.ToShader(tileX, tileY, paintTransform))

Loading…
Cancel
Save