diff options
author | Marius <mariausol@gmail.com> | 2012-02-18 12:20:14 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-02-18 12:20:14 +0200 |
commit | 804ec91e98cd955dc41da3ea7f2a438f485d9b40 (patch) | |
tree | d2f44568123f541c4561e869773960ef8013e421 /metapost | |
parent | fe56e4783cc39ca2f48f4bed60961a6e212e6476 (diff) | |
download | context-804ec91e98cd955dc41da3ea7f2a438f485d9b40.tar.gz |
beta 2012.02.18 10:50
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mp-core.mpiv | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/metapost/context/base/mp-core.mpiv b/metapost/context/base/mp-core.mpiv index 509801b02..c0718397d 100644 --- a/metapost/context/base/mp-core.mpiv +++ b/metapost/context/base/mp-core.mpiv @@ -1139,30 +1139,31 @@ vardef do_draw_par (expr p) = enddef ; vardef baseline_grid (expr pxy, pdir, at_baseline) = - if (par_line_height>0) and (bbheight(pxy)>1) and (bbwidth(pxy)>1) and (boxgridwidth>0) : + save width ; width := bbwidth(pxy) ; + save height ; height := bbheight(pxy) ; + if (par_line_height>0) and (height>1) and (width>1) and (boxgridwidth>0) : save i, grid, bb ; picture grid ; pair start ; path bb ; def _do_ (expr start) = % 1 = normal, 2 = with background (i.e. no shine-through) if boxdashtype = 2 : - draw - start -- start shifted (bbwidth(pxy),0) - withpen pencircle scaled boxgridwidth - boxfilloptions ; + draw start -- start shifted (width,0) + withpen pencircle scaled boxgridwidth + boxfilloptions ; fi ; - draw start -- start shifted (bbwidth(pxy),0) + draw start -- start shifted (width,0) if boxdashtype > 0 : dashed evenly fi withpen pencircle scaled boxgridwidth boxgridoptions ; enddef ; - grid := image ( %fails with inlinespace + grid := image ( % fails with inlinespace if pdir=up : - for i = if at_baseline : par_strut_depth else : 0 fi step par_line_height until max(bbheight(pxy),par_line_height) : + for i = if at_baseline : par_strut_depth else : 0 fi step par_line_height until max(height,par_line_height) : _do_ (llcorner pxy shifted (0,+i)) ; endfor ; else : - for i = if at_baseline : par_strut_height else : 0 fi step par_line_height until bbheight(pxy) : + for i = if at_baseline : par_strut_height else : 0 fi step par_line_height until height : _do_ (ulcorner pxy shifted (0,-i)) ; endfor ; fi ; |