File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1143,12 +1143,16 @@ where parent is not null && n.Node.AllowCoalesing
11431143 // affects different sets of properties then they can be combined into one.
11441144 void CoalesceOrthogonalContainerVisuals ( ObjectGraph < Node > graph )
11451145 {
1146- // If a container is not animated and has no properties set, its children can be inserted into its parent.
1146+ // If a container is not animated and has no properties set, its children can be inserted into its parent,
1147+ // except the root node. We should not change the root node since the user can try to change width/height/scale
1148+ // of the root node and in combination with non-null Clip property (or others)
1149+ // this can lead to incorrect animation.
11471150 var containersWithASingleContainer = graph . CompositionObjectNodes . Where ( n =>
11481151 {
11491152 // Find the ContainerVisuals that have a single child that is a ContainerVisual.
11501153 return
11511154 n . Object is ContainerVisual container &&
1155+ n . Object != graph . Root . Object &&
11521156 container . Children . Count == 1 &&
11531157 container . Children [ 0 ] . Type == CompositionObjectType . ContainerVisual ;
11541158 } ) . ToArray ( ) ;
You can’t perform that action at this time.
0 commit comments