зеркало из https://github.com/AvaloniaUI/Avalonia.git
Added a TextBox and Image to animated controls.
Looks like in the TexbBox clipping rects aren't getting applied correctly with rotation.
This commit is contained in:
Родитель
38cc09ac8f
Коммит
60ad99c8c1
|
@ -465,7 +465,7 @@ namespace TestApplication
|
|||
private static TabItem AnimationsTab()
|
||||
{
|
||||
Border border1;
|
||||
Rectangle rect2;
|
||||
Border border2;
|
||||
RotateTransform rotate;
|
||||
Button button1;
|
||||
|
||||
|
@ -494,19 +494,27 @@ namespace TestApplication
|
|||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Background = Brushes.Crimson,
|
||||
RenderTransform = new RotateTransform(),
|
||||
Content = new Border
|
||||
Content = new TextBox
|
||||
{
|
||||
Background = Brushes.Gainsboro,
|
||||
Margin = new Thickness(25),
|
||||
}
|
||||
Background = Brushes.White,
|
||||
Text = "Hello!",
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
},
|
||||
}),
|
||||
(rect2 = new Rectangle
|
||||
(border2 = new Border
|
||||
{
|
||||
Width = 100,
|
||||
Height = 100,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Fill = Brushes.Coral,
|
||||
Background = Brushes.Coral,
|
||||
Content = new Image
|
||||
{
|
||||
Source = new Bitmap("github_icon.png"),
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
},
|
||||
RenderTransform = (rotate = new RotateTransform
|
||||
{
|
||||
PropertyTransitions = new PropertyTransitions
|
||||
|
@ -534,14 +542,14 @@ namespace TestApplication
|
|||
|
||||
button1.Click += (s, e) =>
|
||||
{
|
||||
if (rect2.Width == 100)
|
||||
if (border2.Width == 100)
|
||||
{
|
||||
rect2.Width = rect2.Height = 400;
|
||||
border2.Width = border2.Height = 400;
|
||||
rotate.Angle = 180;
|
||||
}
|
||||
else
|
||||
{
|
||||
rect2.Width = rect2.Height = 100;
|
||||
border2.Width = border2.Height = 100;
|
||||
rotate.Angle = 0;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace Perspex.Direct2D1
|
|||
{
|
||||
if (visual.IsVisible && visual.Opacity > 0)
|
||||
{
|
||||
// Translate an existing transform into this controls coordinate system.
|
||||
// Translate any existing transform into this controls coordinate system.
|
||||
Matrix offset = Matrix.Translation(visual.Bounds.Position);
|
||||
transform = offset * transform * -offset;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче