|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using Avalonia.Controls.Shapes; |
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using Avalonia.Controls.Shapes; |
|
|
|
using Avalonia.Media; |
|
|
|
using Avalonia.UnitTests; |
|
|
|
using Xunit; |
|
|
|
@ -34,5 +35,24 @@ namespace Avalonia.Controls.UnitTests.Shapes |
|
|
|
|
|
|
|
root.Child = null; |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Arrange_Without_Measure_Updates_RenderedGeometry_Transform() |
|
|
|
{ |
|
|
|
using var app = UnitTestApplication.Start(TestServices.MockPlatformRenderInterface); |
|
|
|
|
|
|
|
var target = new Path |
|
|
|
{ |
|
|
|
Data = new RectangleGeometry { Rect = new Rect(0, 0, 100, 100) }, |
|
|
|
Stretch = Stretch.Fill, |
|
|
|
}; |
|
|
|
|
|
|
|
target.Measure(new Size(200, 200)); |
|
|
|
target.Arrange(new Rect(0, 0, 200, 200)); |
|
|
|
Assert.Equal(Matrix.CreateScale(2, 2), target.RenderedGeometry.Transform.Value); |
|
|
|
|
|
|
|
target.Arrange(new Rect(0, 0, 300, 300)); |
|
|
|
Assert.Equal(Matrix.CreateScale(3, 3), target.RenderedGeometry.Transform.Value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|