|
|
|
@ -55,12 +55,13 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
foreach (var child in Children) |
|
|
|
{ |
|
|
|
var info = (AdornedElementInfo)child.GetValue(s_adornedElementInfoProperty); |
|
|
|
var info = child.GetValue(s_adornedElementInfoProperty); |
|
|
|
|
|
|
|
if (info != null && info.Bounds.HasValue) |
|
|
|
{ |
|
|
|
child.RenderTransform = new MatrixTransform(info.Bounds.Value.Transform); |
|
|
|
child.RenderTransformOrigin = new RelativePoint(new Point(0,0), RelativeUnit.Absolute); |
|
|
|
UpdateClip(child, info.Bounds.Value); |
|
|
|
child.Arrange(info.Bounds.Value.Bounds); |
|
|
|
} |
|
|
|
else |
|
|
|
@ -80,6 +81,19 @@ namespace Avalonia.Controls.Primitives |
|
|
|
layer?.UpdateAdornedElement(adorner, adorned); |
|
|
|
} |
|
|
|
|
|
|
|
private void UpdateClip(IControl control, TransformedBounds bounds) |
|
|
|
{ |
|
|
|
var clip = control.Clip as RectangleGeometry; |
|
|
|
|
|
|
|
if (clip == null) |
|
|
|
{ |
|
|
|
clip = new RectangleGeometry { Transform = new MatrixTransform() }; |
|
|
|
control.Clip = clip; |
|
|
|
} |
|
|
|
|
|
|
|
clip.Rect = bounds.Clip.TransformToAABB(-bounds.Transform); |
|
|
|
} |
|
|
|
|
|
|
|
private void ChildrenCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) |
|
|
|
{ |
|
|
|
switch (e.Action) |
|
|
|
|