/// <summary> /// Get the bounding box of the node /// </summary> /// <remarks> /// This is used for bounding box calculations and includes the visual shadow. /// </remarks> protected override RectD GetBounds(ICanvasContext context, INode node) { RectD bounds = node.Layout.ToRectD(); // expand bounds to include dropshadow bounds = new RectD(bounds.X, bounds.Y, bounds.Width + dropShadowOffset, bounds.Height + dropShadowOffset); // Add label centers to bounds in order to include label edges if (node.Labels.Count > 0) { foreach (var label in node.Labels) { bounds = RectD.Add(bounds, label.GetLayout().GetCenter()); } } return(bounds); }