Is there a way to offset/move the arrowhead mark along the line? #161
-
I want to add the ability to use arrows in my WIP flowchart library. But apparently the tip of the arrow is longer than the line length itself. And the arrow only looks good with I have a very messy workaround of checking if the The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You have two options: Fill the arrow but set it's stroke to none, or set the stroke cap style to something different (https://typst.app/docs/reference/visualize/line/#parameters-stroke). Offsetting the arrow is currently not possible. |
Beta Was this translation helpful? Give feedback.
If I set arrow's stroke to none, then the line beneath the arrow will be seen near the tip:
cap
style doesn't change anything, butjoin
does. If I setjoin
to"round"
, then given the same thickness, it now doesn't show up from the other side:If I instead use default
join: "miter"
and change the value ofmiter-limit
to2
(from default4.0
) then it will cut out the tip of the arrow:With
miter-limit: 1
the effect will be equal tojoin: "bevel"
(all 3 corners are cut/clipped):I've checked: the
cap
only changes style of the non-fill
arrow (join
&miter-limit
will work).Note: this isn't a 100% perfect solution, because the arrow tip itself is never seen with thickness more than ~
0.1pt
.