Rectangle GetUpdatedRegionAndCleanUpAffectedObjects() { Rectangle rect = Rectangle.CreateAnEmptyBox(); var affectedObjectList = new List <IViewerObject>(CurrentUndoAction.AffectedObjects); foreach (var ivObj in affectedObjectList) { var inode = ivObj as IViewerNode; if (inode == null) { continue; } var node = (GeomNode)inode.DrawingObject.GeometryObject; NodeRestoreData nrd = (NodeRestoreData)CurrentUndoAction.GetRestoreData(node); var oldBoundingBox = nrd.BoundaryCurve.BoundingBox; if (!oldBoundingBox.Equals(node.BoundingBox)) { rect.Add(node.BoundingBox); rect.Add(oldBoundingBox); } else { CurrentUndoAction.RemoveAffectedObject(ivObj); } } foreach (var e in edgesDraggedWithSource.Concat(edgesDraggedWithTarget)) { rect.Add(e.BoundingBox); } rect.Pad(layoutSettings.EdgeRoutingSettings.Padding); return(rect); }
static internal void DragNode(GeomNode node, Point delta, NodeRestoreData restoreData) { node.BoundaryCurve = restoreData.BoundaryCurve.Translate(delta); node.Center = restoreData.Center + delta; }