Photoshop: Unexpected behaviour when applying dashed strokes to open paths

  • 1
  • Problem
  • Updated 3 years ago
  • (Edited)
I came across this problem when trying to create a dotted or dashed line with a solid arrowhead. I actually cannot find a way to draw a simple dotted line without it becoming a loop, or closed path. All my open paths draw with an extra stroke connecting the end points of the path.

Most of these paths are on separate layers. Some, like the dotted line below the curved arrow, consist only of two anchor points. Photoshop treats this line as a loop, stroking outside of the shape with two lines of dots. You can set the line to be centred on the stroke, but you still get two sets of dots. Shapes like the black cloud shape, which was created by drawing a path with the freehand pen tool and then converting it to a shape, clearly show two end points that aren't connected with a path, but when a stroke is applied the stroke joins the two end points as well as going around the shape as expected.

For a user perspective, if you select the straight line tool then set a dashed stroke, the intent is very likely for the line to be dashed from one end to the other, not for the whole line to be surrounded with a dashed line. This problem is exacerbated by the mismatched spacing as the line returns down the other side of the line, as can be seen in the diagonal line on the left.

On another thread there seems to be people saying you can get this working by having the path on its own layer but this doesn't seem to be working for me.
Photo of Alex May

Alex May

  • 4 Posts
  • 0 Reply Likes
  • frustrated

Posted 3 years ago

  • 1
Photo of Cristen Gillespie

Cristen Gillespie

  • 86 Posts
  • 17 Reply Likes
I'm afraid I'm having some difficulty following what you as there appear to be several different methods being used. If you want a single dotted path, and you are willing to use the Pen tool, draw in Shape mode and modify the stroke, no fill, to be a dashed stroke. Do the same with a cloud you don't want joined at the ends and you'll get a stroked outline of your cloud.

The Straight Line tool is really a rectangle shape, very, very narrow. If you want to use that to appear to be a single dashed line, you would use the 1pt weight. If you use more than that, yes, it outlines the line. I know that isn't what we expect with the Line tool, but it's the way it has always been constructed. It allows us to have a very thick line using a Fill.

If you draw with one of the included Shape Arrows, you will get an outlined arrow like the one underneath what I assume is the cloud. If you want an arrow without that, you can use the Pen tool in Shape mode and draw your own arrow. If you find that difficult, trace the arrowhead from a Shape you like. Mind, unlike Illustrator, there are no beautiful strokes in PS. You'll have to adjust the dash and the arrowhead shape in order to get the stroke to go around the arrowhead in a pleasing fashion.

Does this help you get the look you're after? It's tricky, I agree. Vector in PS is kind of an afterthought, though it gets better every few years or so.
Photo of Alex May

Alex May

  • 4 Posts
  • 0 Reply Likes
I see what you're saying, and I think that all shapes with regards to strokes are now closed. If you try your suggestion in your second paragraph I suspect you will find you get a dashed line that doesn't match your parameters and changes with the length of the line as the dashed line is really travelling up the line and then back down the other side.

Essentially what you're saying is that it's not possible to do an open-path dashed stroke, which is the problem as stated in the original post, and therefore remains a problem :)
Photo of Alex May

Alex May

  • 4 Posts
  • 0 Reply Likes
I mean, fixing this would be as simple as not drawing the stroke between anchor points that aren't joined and would be a check box in the stroke options.
Photo of Cristen Gillespie

Cristen Gillespie

  • 86 Posts
  • 17 Reply Likes
I'm still not following. Are you saying Adobe should change the Line tool itself? Or that you can't draw what you want with the Pen tool in Shape mode? In the case of the Line tool as it currently is, it doesn't draw a line. It draws a rectangle. If you zoom in, even the smallest 1pt size is a rectangle. It only appears to be a line at normal viewing magnifications. But the Pen tool is definitely a single line, and the dashed stroke you draw with in Shape mode is a single line. I can zoom in to 2200% and it's only one line. I can use it for straight lines or any open path shape I wish to draw.

So exactly why do you need Adobe to change the Line tool to behave like the Pen tool? In the screenshots, at 2200% you can see the anti-aliased pixels with the Pen tool, but also that it is drawing with a single path, not a rectangle.

 In the 100% view, the rough line on far left is drawn with the Line tool. To the right of it is the Line tool used as intended, with a fill. It's clean and solid and can be as thick as you like. It also draws with 2 anchors and that's it. That's it's limit. It's not a path, so you can combine shapes, but not join paths. The others are straight and curved shapes drawn with the Pen tool. The far one uses a heavy stroke weight. The others a very small stroke weight.
Photo of Alex May

Alex May

  • 4 Posts
  • 0 Reply Likes
OK, thanks for this. I have identified the problems. There are two problems.
Creating paths with the pen tool set to "shape" creates open paths that can have a stroke.
Creating paths with the pen tool set to "path" and then converting those to shapes using the shape button on the toolbar creates a closed path regardless of the path's anchor points being connected at the ends. Stroking such a path results in a looped stroke and this cannot be changed. This is the first problem.

The second problem is semantic and relates to the line tool not actually creating lines but rectangles, as you say. Intuitively when you create a line you expect its width to represent the stroke width. The line tool should create a path with a single stroke just as if you'd used the pen tool to create a line with two anchor points. The problem with arrow heads complicates this idea as the arrow heads are incorporated into the shape at creation time (the reason why changing the width and arrow head parameters does not affect existing arrows/lines but changing the stroke options does). That's a technical problem I don't have to solve; I am simply reporting what I expect to happen as a user.
Photo of Cristen Gillespie

Cristen Gillespie

  • 86 Posts
  • 17 Reply Likes
> That's a technical problem I don't have to solve; I am simply reporting what I expect to happen as a user.>

That works for me.    I just was hoping we'd get to a workaround for your needs so while you're waiting for Adobe to address this issue. . . "-}