-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Window] Fix transforms being offset by 0.5x0.5 (#20454)
* Fix transforms being offset by 0.5x0.5 * Added visual regression test * Adjust tests * Fix ref image * update baseline img again... --------- Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
- Loading branch information
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/Controls/samples/Controls.Sample.UITests/Issues/Issue17694.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 17694, "Circle view not rotating from center", PlatformAffected.UWP)] | ||
public class Issue17694 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var circleView = new CircleView | ||
{ | ||
HeightRequest = 50, | ||
WidthRequest = 50, | ||
Drawable = new CircleDraw() | ||
}; | ||
|
||
var button = new Button() | ||
{ | ||
AutomationId = "Spin", | ||
Text = "Spin", | ||
}; | ||
button.Clicked += (s, e) => | ||
{ | ||
circleView.Rotation = 180; | ||
}; | ||
|
||
var stack = new VerticalStackLayout | ||
{ | ||
circleView, | ||
button | ||
}; | ||
|
||
Content = stack; | ||
} | ||
|
||
public class CircleView : GraphicsView | ||
{ | ||
public CircleView() | ||
{ | ||
|
||
} | ||
} | ||
|
||
public class CircleDraw : IDrawable | ||
{ | ||
public void Draw(ICanvas canvas, RectF dirtyRect) | ||
{ | ||
canvas.FillColor = Colors.Red; | ||
canvas.FillCircle(25, 25, 25); | ||
canvas.StrokeSize = 1f; | ||
canvas.StrokeColor = Colors.Black; | ||
canvas.DrawLine(0, 25, 50, 25); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue17694 : _IssuesUITest | ||
{ | ||
public Issue17694(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "Circle view not rotating from center"; | ||
|
||
[Test] | ||
public void Issue17694Test() | ||
{ | ||
this.IgnoreIfPlatforms(new[] | ||
{ | ||
TestDevice.iOS, | ||
TestDevice.Mac, | ||
TestDevice.Android | ||
}); | ||
|
||
App.WaitForElement("Spin"); | ||
|
||
// 1. Click button | ||
App.Click("Spin"); | ||
|
||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters