Question

Unexpected behavior when using "Line connections" and "Snap to..."


Badge +1

 I am having a challenge when working with lines and objects and snap to grid/guide/object. I am building sequence diagrams with activation objects (vertical rectangles). I am trying to use the grid to keep my lines and objects neat and tidy. When I connect a message line to somewhere on an activation box, it does connect, but it does not snap to the underlying grid/guide. I am working with elbow lines and this behavior often adds an awkward elbow close to the activation object. My workaround is to snap the arrow ends with the grid one square to the right/left of both activation object and then connect the line to the object.

 

I would prefer the line end to both connect to the object and snap to the underlying grid/guide. Is there a document setting that can achieve the behavior I prefer? Or, is this a bug or an enhancement request to an already complex interaction?

 

Please see my document settings and some GIF of the behavior.

 

Document Settings > Grid and snapping

 

Document Settings > Lines

 

Snapping and connection behavior with “Line connections” ON

  • When the elbow line is not straight, the end does not snap to the grid when trying to connect it to the object.
  • When the line is snapped to the grid on one end and the other end is moved to make the line straight, the line snaps to the object and the correct grid line (because it is snapping the line straight).
  • When the connected object is moved, the line moves as expected.

 

Snapping and non-connection behavior with “Line connections” OFF

  • When the elbow line is not straight and the end is brought near the object, the end does snap to the grid.
  • When the target object is moved, the line is not connected to it.

 


Comments

Userlevel 5
Badge +17

 @jamie.crawford.dev Thank you for this question and the detail you included! After reviewing your settings and GIFs, I can confirm the following:

  • All shapes and lines are behaving as expected according to the “line connection” settings you’ve made. When this setting is on, lines “stick” to objects and will move correspondingly when the object is moved. Conversely, when this is disabled, you can move objects that the lines are seemingly touching without pulling the line with it because they are not stuck together. 
  • Snapping behavior is separate from connection behavior - you can still enforce rigid alignment to grids and objects, even if those lines and objects aren’t sticking together. Based on your GIFs, everything is snapping correctly except for the left end of the line in your first GIF - I agree with your assessment that it’s partially snapping once the right end is connected. This is strange! 

As a first step, can you please delete the line you’re experiencing problems with in your first GIF. Ensure that all the snapping settings you want are enabled, and then re-create the line? Some settings don’t applying to already-existing lines, and it seems like this one may have gotten into a strange state. If this fresh start doesn’t resolved it, please let me know!

Badge +1

 Thanks for the reply, @Micah. Please see the GIF below for a demonstration that reflects the full life of the line and a use case with no straight-line workaround: an elbow line whose source and target objects are the same. This is a common sequence diagram use case. For your reference, I have included the two relevant document settings in the GIF. Please let me know if I can provide any additional information.

 

 

Badge +1

Sorry, @Micah , to clarify, I am seeing the behavior I expect when “Line connections” is OFF. 🙂

Userlevel 5
Badge +17

@jamie.crawford.dev Looks like your response is missing a GIF. Happy to keep looking into this!

Badge +1

Hmm, that’s odd. Trying again...it’s a big GIF (~3MB). If this doesn’t work, I’ll split it.

 

Userlevel 5
Badge +17

@jamie.crawford.dev I unfortunately still don’t see it, but that is within the image size limit. Are you trying to embed it like you did in your original post?

Badge +1

Ok, my issue was not waiting for the spinner to clear and indicate the file had uploaded. Here are parts 1 and 2 of the original GIF.

 

Part 1: Shows document settings and creation of a new line.

 

Part 2: Attempting to connect the line ends to the object and snap to the grid.

 

Userlevel 5
Badge +17

Thanks @jamie.crawford.dev! Looks like that’s part 1 above - I can see how in preparation for adding this line to the object (where the origin and endpoint are the same shape), the line is snapping to the grid as expected based on your settings. Is it misbehaving when attempting to connect the endpoints?

Badge +1

Thanks @jamie.crawford.dev! Looks like that’s part 1 above - I can see how in preparation for adding this line to the object (where the origin and endpoint are the same shape), the line is snapping to the grid as expected based on your settings. Is it misbehaving when attempting to connect the endpoints?

Snapping to grid without an object is behaving as expected. And, yes, I expect different behavior than what is shown when connecting the line’s endpoint to the side of an object.

I expect the line’s endpoint to snap to the object’s side in one dimension (the dimension perpendicular to the side) and snap to the grid in the other dimension (the dimension parallel to the side).

In the GIF above, I am trying to connect the line end points to the object’s vertical (Y-axis) side. I expect the end points to snap to the object’s side horizontally (it does) and to the grid vertically (it does not).

If I were trying to connect an end point to an object’s horizontal (X-axis) side, I would expect it to snap to the object in the Y-axis (it would) and to the grid in the X-axis (it would not).

Userlevel 5
Badge +17

Hi Jamie, thanks for your response! I see what you’re describing - thanks for such a clear demonstration. I unfortunately am not able to reproduce this behavior in my testing so far, but I’m happy to keep looking into this. Can you you let me know if you’re experiencing this in only this document, or in all? Does it occur in brand new documents with brand new lines? 

Badge +1

Thank you for your reply, @Micah.

I have tested the following scenarios with the specified results:

Starting with Team folders > New > Lucidchart > Blank document

  • Shape: UML Sequence > Activation rectangle
    • Result: Same behavior as originally described and documented above
  • Shape: Flowchart > Process rectangle (non-standard use case)
    • Result
      • When no endpoint is snapped to the midpoint of the shape’s side, the endpoint snaps there as soon as the end crosses inside the shape
      • When one end is snapped to the midpoint of the shape’s side, the end point snaps to the grid well on either side of the shape’s edge, but when the end point is on/near the shape’s edge itself.

Starting with My Documents > New > Lucidchart > Blank document

  • Shape: UML Sequence > Activation rectangle
    • Result: Semi-expected connecting/snapping behavior
    • Non-Blocking Caveat: Snapping behavior occurs sometimes, but not always. It appears be snappier (better) at higher Zoom and...maybe when the cursor is moving more quickly?
  • Shape: Flowchart > Process rectangle (non-standard use case)
    • Result: Expected connecting/snapping behavior
    • Non-Blocking Caveat: The mid-point snapping of the shape has a very strong snap and overriding it to snap off the midpoint requires increasing its height and a 150%+ zoom
Userlevel 5
Badge +17

Hi @jamie.crawford.dev, thanks for such thorough troubleshooting and documentation, and for your patience. That inconsistency with snapping behavior is definitely not intended, and it does seem there is opportunity to polish here. I’ve filed a bug for our development team to take a closer look. I am so sorry for the trouble, and I’ll be sure to let you know via this thread as soon as I have an update. Again, apologies for the inconvenience - please let me know if you have additional questions or concerns.  

Badge +1

Thanks, @Micah , I appreciate you working through this with me to define the bug parameters and to submit it for review! 🙂

Reply