diff options
Diffstat (limited to 'metapost/context/base/mpiv/mp-tool.mpiv')
-rw-r--r-- | metapost/context/base/mpiv/mp-tool.mpiv | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index f41811413..6c02323c3 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -3754,13 +3754,15 @@ numeric mfun_dash_on, mfun_dash_off ; primarydef p withdashes len = hide ( - save l, t, n, m ; pair t ; + save l, t, n, m, don, doff; pair t ; l := arclength p ; - t := paired(len) ; + t := paired (len) ; m := xpart t + ypart t ; - n := l / (l div m) / m ; - mfun_dash_on := n * xpart t ; - mfun_dash_off := n * ypart t ; + n := (l if not cycle p : - xpart t fi) div m ; + (n if not cycle p : + 1 fi) * don + n * doff = l ; + don*(ypart t) = doff*(xpart t) ; + mfun_dash_on := don ; + mfun_dash_off := doff ; ) p dashed dashpattern (on mfun_dash_on off mfun_dash_off) enddef ; |