diff options
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mpxl/mp-abck.mpxl | 22 | ||||
-rw-r--r-- | metapost/context/base/mpxl/mp-apos.mpxl | 4 |
2 files changed, 23 insertions, 3 deletions
diff --git a/metapost/context/base/mpxl/mp-abck.mpxl b/metapost/context/base/mpxl/mp-abck.mpxl index 7566ae4e4..ebcd2eeb6 100644 --- a/metapost/context/base/mpxl/mp-abck.mpxl +++ b/metapost/context/base/mpxl/mp-abck.mpxl @@ -55,9 +55,31 @@ def boxdashtype = (runscript mfid_mpvarn "dashtype") enddef ; def boxalternative = (runscript mfid_mpvarn "alternative") enddef; def boxdistance = (runscript mfid_mpvard "distance") enddef; +def boxlocation = (runscript mfid_mpvarn "location") enddef ; def boxtopoffset = (runscript mfid_mpvard "topoffset") enddef; def boxbottomoffset = (runscript mfid_mpvard "bottomoffset") enddef; +vardef boxatright = + save b ; b := boxlocation ; + if b = 1 : + false + elseif b = 2 : + true + elseif OnRightPage : + if b = 4 : % outer + true + else : % inner + false + fi + else : + if b = 4 : % inner + false + else : % inner + true + fi + fi +enddef ; + def boxgridoptions = withcolor boxgridcolor enddef ; def boxlineoptions = withcolor boxlinecolor enddef ; def boxfilloptions = withcolor boxfillcolor enddef ; diff --git a/metapost/context/base/mpxl/mp-apos.mpxl b/metapost/context/base/mpxl/mp-apos.mpxl index 3070d3a8a..f43712c23 100644 --- a/metapost/context/base/mpxl/mp-apos.mpxl +++ b/metapost/context/base/mpxl/mp-apos.mpxl @@ -121,9 +121,7 @@ def anch_sidebars_draw(expr b_self, e_self, t_anchor) = % even these three can b else : a := (xpart a, min(ypart a + boxtopoffset,getposheight(t_anchor))) ; b := (xpart b, max(ypart b - boxbottomoffset,0)) ; - % DoubleSided should come from an option of \setupsidebar - save DoubleSided ; boolean DoubleSided ; DoubleSided := true ; - if OnOddPage and DoubleSided : + if boxatright : a := (xpart a + HSize + 2 * boxdistance,ypart a) ; b := (xpart b + HSize + 2 * boxdistance,ypart b) ; fi ; |