(This is my first question here so apologies in advance if I break any rule. I have seen a question on how to align an object relative to nodes here, but I haven't found how to align a node with respect to another object.)

I would like to know the best way to align a node of one object with the middle point of another object. For example, imagine I have a rectangle and a diagonal line (a straight Bezier curve with two nodes). The top node of the line is already aligned with the bottom side of the rectangle in the y axis, but it is at an arbitrary position with respect to the rectangle in the y axis (left). I would like to align the top node of the line with respect to the middle point of the rectangle in the x axis, leaving the bottom node of the line and also the rectangle unchanged (right).

enter image description here

What is the most efficient way to achieve this?


In the Snapping Controls Bar, enable the following snapping options:

  1. Enable Snapping

  2. Snap Nodes, Paths and Handles

  3. Snap Midpoints of Line Segments

Then, using the Pen Tool, mouse over the middle of the line segment, when the midpoint tooltip shows, click to add a node.

See example below. Note the Snapping Controls on the far right of the screenshot. You can see the three that are enabled.

enter image description here

Additionally, if you also enable Snap to Cusp Nodes, you can also click and drag a path to snap its node to the segment midpoint.

enter image description here

  • This does it, thanks a lot! May I ask what program you used to make the animations? I have been looking for a practical and free-source solution for a while. – mgarort Feb 21 at 22:02
  • @mgarort I use ShareX. It's open source. – Billy Kerr Feb 21 at 22:13

Here are two options for you.

Inkscape's connector tool is most useful if you want to constantly tweak the layout. It's a little bit buggy but normally yields handsome results. This tool doesn't work well with snapping enabled.

inkscape connector animation

For more intricate designs use the node tool with snapping.

inkscape snap animation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.