summaryrefslogtreecommitdiff
path: root/metapost/context/base/mpiv/mp-base.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mpiv/mp-base.mpiv')
-rw-r--r--metapost/context/base/mpiv/mp-base.mpiv11
1 files changed, 9 insertions, 2 deletions
diff --git a/metapost/context/base/mpiv/mp-base.mpiv b/metapost/context/base/mpiv/mp-base.mpiv
index 0cc209302..95d1e8d11 100644
--- a/metapost/context/base/mpiv/mp-base.mpiv
+++ b/metapost/context/base/mpiv/mp-base.mpiv
@@ -250,7 +250,7 @@ vardef whatever =
?
enddef ;
-% unary operators
+% unary operators (with patched round)
let abs = length ;
@@ -258,7 +258,14 @@ vardef round primary u =
if numeric u :
floor(u+.5)
elseif pair u :
- (round xpart u, round ypart u)
+ (floor(xpart u+.5), floor(ypart u+.5))
+ elseif path u :
+ % added by HH
+ for i=0 upto length u-1 :
+ round(point i of u) ..
+ controls round(postcontrol i of u) and round(precontrol i+1 of u) ..
+ endfor
+ if cycle u : cycle else : point infinity of u fi
else :
u
fi