summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-03-28 10:40:16 +0200
committerMarius <mariausol@gmail.com>2013-03-28 10:40:16 +0200
commit6580c0d6985f98e634f2081b00576a15201c536b (patch)
tree65ea74bbb25427b59b23b6fbae8fb0144b9a7a7f /metapost
parentc329996a0750703214534cfa61cfa49fd62b330f (diff)
downloadcontext-6580c0d6985f98e634f2081b00576a15201c536b.tar.gz
beta 2013.03.28 09:26
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-chem.mpiv13
-rw-r--r--metapost/context/base/mp-page.mpiv2
2 files changed, 12 insertions, 3 deletions
diff --git a/metapost/context/base/mp-chem.mpiv b/metapost/context/base/mp-chem.mpiv
index 2c9f8f327..4cb4ce78e 100644
--- a/metapost/context/base/mp-chem.mpiv
+++ b/metapost/context/base/mp-chem.mpiv
@@ -33,7 +33,7 @@ numeric
boolean
chem_setting_axis, %chem_setting_fitwidth, chem_setting_fitheight,
- chem_doing_pb, chem_text_trace, chem_bd_wedge,
+ chem_doing_pb, chem_text_trace, chem_bd_wedge, chem_tracing,
chem_star[], chem_front[], chem_stacked[], chem_tetra[] ;
string
@@ -81,6 +81,7 @@ chem_sb_pair.b := (0, 1 ) ; %chem_sb_dash.b := dashpattern(on 1) ;
chem_text_trace := false ; % debugging
chem_bd_wedge := false ; % true is incorrect, but quite common...
+chem_tracing := false ;
def chem_reset =
chem_rotation := 0 ;
@@ -342,6 +343,7 @@ vardef chem_stop_structure =
endfor
currentpicture := (currentpicture shifted -chem_origin) rotated chem_setting_rotation ;
+
if (not known chem_setting_l) and (not known chem_setting_r) :
chem_setting_l := - xpart llcorner currentpicture ;
chem_setting_r := xpart urcorner currentpicture ;
@@ -371,7 +373,7 @@ vardef chem_stop_structure =
chem_setting_bbox :=
(-chem_setting_l,-chem_setting_b) -- ( chem_setting_r,-chem_setting_b) --
( chem_setting_r, chem_setting_t) -- (-chem_setting_l, chem_setting_t) -- cycle ;
-
+
if chem_setting_axis : % put it behind the picture
chem_pic := currentpicture ; currentpicture := nullpicture ;
chem_num0 := .5chem_b_length ;
@@ -399,7 +401,14 @@ vardef chem_stop_structure =
% frame=on : draw chem_setting_bbox withcolor colorpart(chem_axis_color) ;
addto currentpicture also chem_pic ;
fi ;
+ if chem_tracing :
+ fill boundingbox currentpicture withcolor blue withtransparency(1,.25) ;
+ fi ;
setbounds currentpicture to chem_setting_bbox ;
+ if chem_tracing :
+ fill boundingbox currentpicture withcolor red withtransparency(1,.25) ;
+ fi ;
+ chem_tracing := false ;
enddef ;
% \chemical
diff --git a/metapost/context/base/mp-page.mpiv b/metapost/context/base/mp-page.mpiv
index d263c3617..9c538d42a 100644
--- a/metapost/context/base/mp-page.mpiv
+++ b/metapost/context/base/mp-page.mpiv
@@ -319,7 +319,7 @@ def SetPageArea =
enddef ;
def SetPageLocation =
- pair Location[] ;
+ pair Location[][] ;
for VerPos=Top step 10 until Bottom:
for HorPos=LeftEdge step 1 until RightEdge:
Location[HorPos][VerPos] := (Hstep[HorPos],Vstep[VerPos]) ;