Nevron Forum

Need Stickyer NLineShapes

https://www.nevron.com/Forum/Topic3814.aspx

By Jason Irby - Thursday, July 15, 2010

In our app a user can select an NLineShape connecting two other shapes and do certain things to that line.  The problem is that the slightest movement of the mouse while selecting the line can bump it enough to come unplugged to the shapes it was connected to.

I have noticed that the lineshapes in the designer have a certain amount of “stickyness” where it resists coming unplugged until the line has been drug beyond a certain threshold.  

This is the behaviour I want for my lineshapes but I have not figured out what I need to do.

Is there some kind of threshold property on the line or ports or plugs I need to set?

 

Thanks in advance,

Jason

By Nevron Support - Thursday, July 15, 2010

Hi Jason,

How do you create the 2D shapes that the line shape connects ? It is recommended you use a shape factory, because it creates ports for the 2D shapes by default.

By Jason Irby - Thursday, July 22, 2010

Sorry for the late reply.  I got caught in a release cycle.

I think I have solved my problem.

I was creating my objects from a library viewer.  The objects did have ports.  The shapes I had created the library from originally has a center port and ports around the perimeter.   I had removed all but the center port.

After some research I realized what was happening.  The center port was DynamicPort and the perimeter ports were RotateBoundsPorts.  I hadn’t realized they were different.  They seem to have slightly different stickiness.

If I made my one port a RotatedBoundsPort, it had the sticky behaviour I wanted.  If I used a  DynamicPort, it wasn’t sticky enough.  I noticed that if I changed the DynamicPort’s  glue mode from GlueToContour,  to GlueToLocation , the port became stickier.   That’s an acceptable solution for now.

 

Clear as mud?

Thanks,

Jason Irby