Hi Pramod,
Different port types use different strategies to determine their location in document scene coordinates.
The NRotatedBoundsPort for example computes its location by first generating a point defined in percents of the anchor model - model bounds and transforming this point to scene coordinates using the anchor model SceneTransform. The following code snippet is the implementation of the NRotatedBoundsPort GetLocation method override:
///
/// Overiden to obtain an aligned point relative to the anchor model rotated bounds
/// and apply the current offset to it.
/// ///
protected override NPointF GetLocation()
{
if (Shape != null && Shape.IsCollapsed())
return Shape.GetRootCollapsedShape().GetCollapsedPortLocation(this);
NModel model = GetAnchorModel(AnchorUniqueId);
if (model == null)
return NPointF.Empty;
NPointF point = Alignment.GetAlignPoint(model.ModelBounds);
point = model.SceneTransform.TransformPoint(point);
point.X += Offset.Width;
point.Y += Offset.Height;
return point;
}
So naturally when the anchor model model bounds have changed, the location of the port also changes, because it is defined relatively to the anchor model bounds.
In general any custom port location can be achieved by creating a custom port. What is the behavior that you want to achieve?
Best Regards,
Nevron Support Team