private void HandleLoopBoundsChanges(BoundsChangeMerger <Loop> boundsChanges)
        {
            foreach (var change in boundsChanges)
            {
                SMRect oldBounds = change.OldBounds;
                SMRect newBounds = change.NewBounds;
                // Don't move things on structure move.
                if (!change.IsResize)
                {
                    continue;
                }

                var   element  = change.TargetElement;
                float leftDiff = newBounds.Left - oldBounds.Left;
                float topDiff  = newBounds.Top - oldBounds.Top;
                foreach (BorderNode node in element.BorderNodes)
                {
                    if (BorderNode.GetBorderNodeDockingAxis(node.Docking) == BorderNodeDockingAxis.Horizontal)
                    {
                        node.Left -= leftDiff;
                    }
                    else
                    {
                        node.Top -= topDiff;
                    }
                }
                ViewElementOverlapHelper.PreventBorderNodeOverlap(element, g => ViewElementOverlapHelper.PreventBorderNodeOverlap(g));
                element.BorderNodes.ForEach(bn => bn.EnsureDocking());
            }
        }
Exemple #2
0
 private void HandleBorderNodeBoundsChanges(BoundsChangeMerger <BorderNode> boundsChanges)
 {
     foreach (var change in boundsChanges)
     {
         ViewElementOverlapHelper.PreventBorderNodeOverlap(change.TargetElement.Structure);
     }
     CoreBatchRule.HandleBorderNodeChanges <Loop>(boundsChanges);
 }
        private void HandleBorderNodeBoundsChanges(BoundsChangeMerger <BorderNode> boundsChanges)
        {
            foreach (var change in boundsChanges)
            {
                var borderNode = change.TargetElement;
                if (borderNode.Structure is Loop)
                {
                    ViewElementOverlapHelper.PreventBorderNodeOverlap(borderNode.Structure, g => ViewElementOverlapHelper.PreventBorderNodeOverlap(g));
                }
            }

            CoreBatchRule.HandleBorderNodeChanges <Loop>(boundsChanges);
        }