|
|
@@ -52,6 +52,7 @@ namespace Perspex.SceneGraph.UnitTests
|
|
|
{
|
|
|
Width = 10,
|
|
|
Height = 10,
|
|
|
+ ClipToBounds = true,
|
|
|
[Canvas.LeftProperty] = 110,
|
|
|
[Canvas.TopProperty] = 110,
|
|
|
})
|
|
|
@@ -86,6 +87,7 @@ namespace Perspex.SceneGraph.UnitTests
|
|
|
{
|
|
|
Width = 10,
|
|
|
Height = 10,
|
|
|
+ ClipToBounds = true,
|
|
|
[Canvas.LeftProperty] = 50,
|
|
|
[Canvas.TopProperty] = 50,
|
|
|
})
|
|
|
@@ -99,9 +101,8 @@ namespace Perspex.SceneGraph.UnitTests
|
|
|
Assert.False(target.Rendered);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
[Fact]
|
|
|
- public void Nested_ClipToBounds_Should_Be_Respected()
|
|
|
+ public void RenderTransform_Should_Be_Respected()
|
|
|
{
|
|
|
TestControl target;
|
|
|
var container = new Canvas
|
|
|
@@ -111,32 +112,24 @@ namespace Perspex.SceneGraph.UnitTests
|
|
|
ClipToBounds = true,
|
|
|
Children = new Controls.Controls
|
|
|
{
|
|
|
- new Canvas
|
|
|
+ (target = new TestControl
|
|
|
{
|
|
|
- Width = 50,
|
|
|
- Height = 50,
|
|
|
- ClipToBounds = true,
|
|
|
- Children = new Controls.Controls
|
|
|
- {
|
|
|
- (target = new TestControl
|
|
|
- {
|
|
|
- Width = 10,
|
|
|
- Height = 10,
|
|
|
- [Canvas.LeftProperty] = 50,
|
|
|
- [Canvas.TopProperty] = 50,
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ Width = 10,
|
|
|
+ Height = 10,
|
|
|
+ [Canvas.LeftProperty] = 110,
|
|
|
+ [Canvas.TopProperty] = 110,
|
|
|
+ RenderTransform = new TranslateTransform(-100, -100),
|
|
|
+ })
|
|
|
}
|
|
|
};
|
|
|
|
|
|
Render(container);
|
|
|
|
|
|
- Assert.False(target.Rendered);
|
|
|
+ Assert.True(target.Rendered);
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void RenderTransform_Should_Be_Respected()
|
|
|
+ public void Negative_Margin_Should_Be_Respected()
|
|
|
{
|
|
|
TestControl target;
|
|
|
var container = new Canvas
|
|
|
@@ -146,14 +139,16 @@ namespace Perspex.SceneGraph.UnitTests
|
|
|
ClipToBounds = true,
|
|
|
Children = new Controls.Controls
|
|
|
{
|
|
|
- (target = new TestControl
|
|
|
+ new Border
|
|
|
{
|
|
|
- Width = 10,
|
|
|
- Height = 10,
|
|
|
- [Canvas.LeftProperty] = 110,
|
|
|
- [Canvas.TopProperty] = 110,
|
|
|
- RenderTransform = new TranslateTransform(-100, -100),
|
|
|
- })
|
|
|
+ Margin = new Thickness(100, 100, 0, 0),
|
|
|
+ Child = target = new TestControl
|
|
|
+ {
|
|
|
+ Width = 10,
|
|
|
+ Height = 10,
|
|
|
+ Margin = new Thickness(-100, -100, 0, 0),
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|