How to make the port position on the node unchanged when the node adjusts the height with the lane?

I set the node in swimlane so that when the height of the swimlane is adjusted, the height of the node can also be adjusted together, but although the height of the node has changed, the port on the node also changes with the height of the node. The following is a gif that demonstrates this phenomenon : 

https://drive.google.com/file/d/17NicCNsHnSojxYTC7vc6hwxzdhFz0f-j/view?usp=sharing

You can see that when the node height changes, the port height also changes


4 Replies

DT Deepa Thiruppathy Syncfusion Team June 28, 2022 11:35 AM UTC

Hi Tealer,


We are checking on your requirement. We will update the more details on June 29, 2022.


Regards,

Deepa Thiruppathy



KR Karkuvel Rajan Shanmugavel Syncfusion Team June 29, 2022 11:43 AM UTC

Hi Tealer,


Requirement: Need to make the port position in the node static while resizing the node too.


We have prepared a simple sample to achieve your requirement. In the sample, we have used PropertyChanged to achieve your requirement. Please find the code example and sample below.


Code example:


 

                        var newHeight = node.UnitHeight + heightDifference;

                        var nodeBounds = (node.Info as INodeInfo).Bounds;

                        if (node.Ports is PortCollection ports && ports.Count > 0)

                        {

                            var dockportCollection = ports.Where(e => e is IDockPort).ToList();

                            foreach (IDockPort dockport in dockportCollection)

                            {

                                var sourcePointY = nodeBounds.Height * dockport.SourcePoint.Y;

                                var targetPointY = nodeBounds.Height * dockport.TargetPoint.Y;

                                dockport.SourcePoint = new Point(dockport.SourcePoint.X, sourcePointY / newHeight);

                                dockport.TargetPoint = new Point(dockport.TargetPoint.X, targetPointY / newHeight);

                            }

                        }

 


Sample link: https://www.syncfusion.com/downloads/support/forum/175898/ze/Swimlane-2114992106


Regards,

Karkuvel Rajan S



TE tealer June 30, 2022 02:38 AM UTC

Thanks for solving my problem!



DT Deepa Thiruppathy Syncfusion Team June 30, 2022 04:54 AM UTC

You are welcome. Please let us know if you require any further assistance.


Loader.
Up arrow icon