The \arrowsize
length is only an auxiliary dimen that you can use to calculate a length. It does not actually have anything to do with size of the arrow tip.
The right extend is the length the line will be shorten when the arrow tip is applied. This also does move the origin of the arrow coordinate system (the \pgfpointorigin
you use). You need to take the same amount into consideration if you want to draw the arrow.
The line has to be shortened by 1.5
its width.
The left extend (which is actually only needed if you want to combine arrow tips) is then 5pt-1.5\pgflinewidth
. I have used basic TeX dimen calculation and the \pgfutil@tempdima
dimen to calculate this so that the PGF math parser isn't needed (as indicated and forced by the +
in the extend macros).
The \pgftransformshift
macro is used to shift the origin back to the tip of the arrow.
The q
uick version of \pgfpoint
is used as its arguments do not need to get parsed by PGF math, either.
Instead of another \pgfpathlineto
I used \pgfpathclose
(this is the low-level equivalent of -- cycle
) even though you use filling and the closing is implied.
The backgrounds
library and its gridded
option is only used so one can easily spot the coordinates (0,0)
and (1,0)
. The second picture is the result of opacity=.5
and shows the line and the arrow tip separately.
Code
\documentclass[tikz,convert=false]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds}
\makeatletter
\pgfarrowsdeclare{ipe arrow}{ipe arrow}{%
\pgfutil@tempdima=5pt\relax
\advance\[email protected]\pgflinewidth
\pgfarrowsleftextend{+-\pgfutil@tempdima}%
\pgfarrowsrightextend{+1.5\pgflinewidth}%
}{%
\pgftransformshift{\pgfqpoint{1.5\pgflinewidth}{0pt}}%
\pgfpathmoveto{\pgfpointorigin}%
\pgfpathlineto{\pgfqpoint{-5pt}{-1.666pt}}%
\pgfpathlineto{\pgfqpoint{-5pt}{+1.666pt}}%
\pgfpathclose
\pgfusepathqfill
}
\makeatother
\begin{document}
Output

