summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/mp-tool.mp11
1 files changed, 9 insertions, 2 deletions
diff --git a/metapost/context/mp-tool.mp b/metapost/context/mp-tool.mp
index e24bd45e9..1c8dc83f2 100644
--- a/metapost/context/mp-tool.mp
+++ b/metapost/context/mp-tool.mp
@@ -1732,11 +1732,18 @@ enddef ;
% handy
vardef bbwidth (expr p) =
- (if known p : xpart (lrcorner p - llcorner p) else : 0 fi)
+ (if known p :
+ if path p or picture p :
+ xpart (lrcorner p - llcorner p)
+ else : 0 fi else : 0
+ fi )
enddef ;
vardef bbheight (expr p) =
- (if known p : ypart (urcorner p - lrcorner p) else : 0 fi)
+ (if known p : if path p or picture p :
+ ypart (urcorner p - lrcorner p)
+ else : 0 fi else : 0
+ fi)
enddef ;
color nocolor ; numeric noline ; % both unknown signals