38 |
dbg = config.dbg.shorthand('mp') |
dbg = config.dbg.shorthand('mp') |
39 |
dbg_fail = config.dbg.shorthand('mp.fail') |
dbg_fail = config.dbg.shorthand('mp.fail') |
40 |
|
|
41 |
|
rough_edges = [] |
42 |
|
|
43 |
def link_draw_code(self): |
def link_draw_code(self): |
44 |
if config.mp_eps_only: return '' |
if config.mp_eps_only: return '' |
45 |
if self.error: return 'showlinkerror("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
if self.error: return 'showlinkerror("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
46 |
if not self.focus: return 'showlink("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
if not self.focus: return 'showlink("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
47 |
else: |
else: |
48 |
if self.rough_edge: |
if self.rough_edge: |
49 |
return 'showfocus("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' \ |
navidoc.mp.rough_edges.extend([self.bbox]) |
50 |
+"\n"+'drawRoughEdge(('+self.bbox+'));' |
return 'showfocus("'+self.target+'", "'+self.title+'", ('+self.bbox+'));'+"\n" |
51 |
else: return 'showfocus("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
else: return 'showfocus("'+self.target+'", "'+self.title+'", ('+self.bbox+'));' |
52 |
navidoc.link.Link.draw_code = link_draw_code |
navidoc.link.Link.draw_code = link_draw_code |
53 |
|
|
94 |
self.do_contents(list) |
self.do_contents(list) |
95 |
if self.link != None: |
if self.link != None: |
96 |
self.link.bbox = ('bboxmeasuredpic(%s)' % (self.var)) |
self.link.bbox = ('bboxmeasuredpic(%s)' % (self.var)) |
97 |
self.link.rough_edge = 0 |
self.link.rough_edge = 1 |
98 |
def setup_code(self): |
def setup_code(self): |
99 |
s = """ |
s = """ |
100 |
picture %%.pict; |
picture %%.pict; |
195 |
gen2 = open(dir+diagram+context+'.gen.mp.2', 'w') |
gen2 = open(dir+diagram+context+'.gen.mp.2', 'w') |
196 |
gen2.write(m.draw_code()+"\n") |
gen2.write(m.draw_code()+"\n") |
197 |
gen2.write(draw_extra+"\n") |
gen2.write(draw_extra+"\n") |
198 |
|
|
199 |
|
global rough_edges |
200 |
|
for rough_bbox in rough_edges: |
201 |
|
"""Print stored roughEdges now, on top of everything else.""" |
202 |
|
gen2.write('drawRoughEdge(('+rough_bbox+'), (bbox currentpicture));'+"\n") |
203 |
gen2.write('showlinksize("bbox", "'+diagram+'", (bbox currentpicture));'+"\n") |
gen2.write('showlinksize("bbox", "'+diagram+'", (bbox currentpicture));'+"\n") |
204 |
gen2.close() |
gen2.close() |
205 |
|
rough_edges = [] |
206 |
|
|
207 |
gen3 = open(dir+diagram+context+".gen.mp.3", "w") |
gen3 = open(dir+diagram+context+".gen.mp.3", "w") |
208 |
gen3.write(""" |
gen3.write(""" |
209 |
prologues := 1; |
prologues := 1; |