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:
Steven Kirk 2014-12-17 03:58:37 +01:00
Родитель 38cc09ac8f
Коммит 60ad99c8c1
2 изменённых файлов: 19 добавлений и 11 удалений

Просмотреть файл

@ -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;