diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-04-15 20:34:40 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-04-15 20:34:40 +0200 |
commit | b155eafa1e2d73692eed08ecabeb5ad589ac11dc (patch) | |
tree | ec352f240efa570d5e06db368ce3dd99e792545a /metapost/context/base/mpiv | |
parent | 1e69816bbbeebedafd52684fc4182ce977d92a8a (diff) | |
download | context-b155eafa1e2d73692eed08ecabeb5ad589ac11dc.tar.gz |
2022-04-15 20:15:00
Diffstat (limited to 'metapost/context/base/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 ; |