16

When I add markers to a path in Inkscape (e.g. arrowheads), they do not exactly end at the end of the path. How can I position the arrowhead so that it exactly ends at the end of the path?

http://i.imgur.com/Os9azgs.png

1

5 Answers 5

7

The point at which the marker will “graft” onto the path is the center of the defined marker (i.e. 0,0).

You can position it by changing the path definition either globally in the markers.svg (on Windows something like c:\programs\Inkscape\share\markers\markers.svg), or by changing the marker definition in the SVG itself with the XML editor.

In the image below, I have changed the tip of the arrow to be at 0,0.

change marker definition in file itself

However, it is hard to get the position 100% correct since the stroke of the arrow will add some width.

One problem you might encounter (depending on your “main” path definition, size of marker, width of path, etc.) is that the main path might bleed through the marker (see below)

marker does not cover path completly

5

The path marker functionality in Inkscape is woefully limited. I would suggest creating your arrowhead as a separate path object, from scratch. It's definitely cumbersome for designs that include a large number of arrows, but you will have a lot more control over the size and position of the arrowhead.

3
  • 1
    Can I access the arrowhead "sources" from inkscape? If I were to create a group of a path and a separate arrowhead object, can I restrict the arrowhead from changing when e.g. resizing the group?
    – m.s.
    Apr 8, 2015 at 13:02
  • 1
    You can obtain an Inkscape arrowhead as a path (to position precisely) by applying the arrowhead to a path and then choosing "Path" > "Stroke to path".
    – Sean
    Apr 8, 2015 at 13:28
  • As far as I know, there's no easy way to resize a group without affecting the size of all containing objects. Interesting idea though!
    – Sean
    Apr 8, 2015 at 13:29
5

An alternative to the other options in this thread: you can change the nodes by adding a border. Like so:

border around node does the trick

The border must be chosen so that it sits at the right distance from the node. Then simply group the node and the border together, and make the border invisible. A connector will now sit at exactly the distance you want it to be.

The disadvantage of this is that the backedges are now also at a distance from the node. This may or may not be a problem for you. If it is, then one way of solving this is creating an "extension marker". Create a horizontal line: and choose "object to marker" in the "object" menu.

The fixing start marker

Then select this new marker as a start marker for your connectors.

2

I find having "Snap bounding boxes" enabled is the easiest way to make sure that the arrow tip gets aligned to the edge of the other item.

I then resise the stroke with the arrow head such that it aligns with the bounding box of the line. Take a look at this screenshot for the snap settings inkscape snap settings

and the screenshot below for this method in action in inkscape.

inkscape screenshot of snap to bounding boxes.

1

My way:

1) Draw your arrow and an extra line/bar

Step 1

2) Place the arrow manually (without snapping) as you wish the arrowhead shall be to other objects. Place the bar at the arrowhead (snapping).

Step 2

3) Make the bar 100% transparent (0% opaque). Step 3

Finally: Group the arrow and the bar so you can use copies of this group for well aligned/positioned arrows.

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.