-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue5395.cs
59 lines (51 loc) · 1.71 KB
/
Issue5395.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 5395, "[macOs] Image Rotation issue", PlatformAffected.macOS)]
public class Issue5395 : ContentPage
{
public Issue5395()
{
var sl = new StackLayout() { Orientation = StackOrientation.Vertical };
sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its center" });
sl.Children.Add(new TestImage(0.5, 0.5, true, false));
sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its top left corner" });
sl.Children.Add(new TestImage(0, 0, true, false));
sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its top right corner" });
sl.Children.Add(new TestImage(1, 0, true, false));
sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its bottom right corner" });
sl.Children.Add(new TestImage(1, 1, true, false));
sl.Children.Add(new Label() { Text = "Image should scale on its center" });
sl.Children.Add(new TestImage(0.5, 0.5, false, true));
Content = sl;
}
class TestImage : Image
{
public TestImage(double anchorx, double anchory, bool rotate, bool scale)
{
VerticalOptions = HorizontalOptions = LayoutOptions.Center;
Aspect = Aspect.AspectFit;
Source = "bank.png";
WidthRequest = 30;
HeightRequest = 30;
BackgroundColor = Color.Red;
AnchorX = anchorx;
AnchorY = anchory;
//TranslationX = -50;
//TranslationY = 25;
if (rotate)
{
this.RotateTo(3600, 10000);
}
if (scale)
{
this.ScaleTo(2, 4000);
}
Margin = 30;
}
}
}
}