/[navidoc]/navidoc/navidoc/mp/__init__.py
ViewVC logotype

Diff of /navidoc/navidoc/mp/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by humppake, Thu May 22 10:52:21 2003 UTC revision 1.30 by humppake, Thu May 22 14:17:25 2003 UTC
# Line 277  def mp2png(diagram, scale=1.0): Line 277  def mp2png(diagram, scale=1.0):
277      dbg("List: "+str(list))      dbg("List: "+str(list))
278      syscmd = ('pstopnm '+' '.join(list)+' <'+slashify(config.mp_directory)+diagram+config.midfix \      syscmd = ('pstopnm '+' '.join(list)+' <'+slashify(config.mp_directory)+diagram+config.midfix \
279                +""".mp.1 2>/dev/null | pnmscale -reduce %s 2>/dev/null | """%scaling \                +""".mp.1 2>/dev/null | pnmscale -reduce %s 2>/dev/null | """%scaling \
280                +'pnmtopng >'+slashify(config.mp_directory)+diagram+config.midfix+'.png 2>/dev/null')#                +'pnmtopng -transparent =white >'+slashify(config.mp_directory) \
281                  +diagram+config.midfix+'.png 2>/dev/null')#
282    
283      dbg(syscmd)      dbg(syscmd)
284      os.system(syscmd)      os.system(syscmd)
# Line 287  class psbbox: Line 288  class psbbox:
288      PostScriptBoundingBox.      PostScriptBoundingBox.
289      """      """
290      def __init__(self, els):      def __init__(self, els):
291          self.x=(round_down(els[0]), round_up(els[2]))          self.x=(int(float(els[0])), int(float(els[2])))
292          self.y=(round_up(els[1]), round_down(els[3]))          self.y=(int(float(els[1])), int(float(els[3])))
293          self.scale = 1 # 1 point = 1 pixel          self.scale = 1 # 1 point = 1 pixel
294          self.w = self.scale*(self.x[1]-self.x[0])          self.w = self.scale*(self.x[1]-self.x[0])
295          self.h = self.scale*(self.y[0]-self.y[1])          self.h = self.scale*(self.y[0]-self.y[1])

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26