diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-10-28 11:38:54 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-10-28 11:38:54 +0200 |
commit | c0e2193b6c379b34fbc589343d31f71e02513f03 (patch) | |
tree | 78e2d71def3ce80cf233c79279dcfddaac18a523 /metapost | |
parent | a23982bf3c6cc3c7e34c89a67004e2ef4c6103eb (diff) | |
download | context-c0e2193b6c379b34fbc589343d31f71e02513f03.tar.gz |
2021-10-28 10:19:00
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 ; |