/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/scalebar.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/scalebar.py

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

revision 869 by frank, Thu May 8 14:06:15 2003 UTC revision 871 by frank, Fri May 9 08:33:29 2003 UTC
# Line 48  class ScaleBar: Line 48  class ScaleBar:
48              interval, unit  = deriveInterval(width, scale)              interval, unit  = deriveInterval(width, scale)
49              interval, label = roundInterval(interval)              interval, label = roundInterval(interval)
50                            
51              # We draw 2 rectangles with half the width              if interval > 0.0:
52              if unit == 'km':                  # We draw 2 rectangles with half the width
53                  width = int(interval*1000.0*scale/2)                  if unit == 'km':
54              else:                      width = int(interval*1000.0*scale/2)
55                  width = int(interval*scale/2)                  else:
56                        width = int(interval*scale/2)
57                            
58              dc.SetPen(BlackPen)                  dc.SetPen(BlackPen)
59    
60              brush = wxBrush(wxWHITE, wxSOLID)                  brush = wxBrush(wxWHITE, wxSOLID)
61              dc.SetBrush(brush)                  dc.SetBrush(brush)
62              dc.DrawRectangle(4,2,width,8)                  dc.DrawRectangle(4,2,width,8)
63    
64              dc.SetBrush(BlackBrush)                  dc.SetBrush(BlackBrush)
65              dc.DrawRectangle(width+4,2,width,8)                  dc.DrawRectangle(width+4,2,width,8)
66    
67              dc.SetTextForeground(BlackText)                  dc.SetTextForeground(BlackText)
68              dc.DrawText("%d"%0, 4 - l1width/2, 12)                  dc.DrawText("%d"%0, 4 - l1width/2, 12)
69    
70              l2width, l2height = dc.GetTextExtent("%s %s"%(label, unit))                  l2width, l2height = dc.GetTextExtent("%s %s"%(label, unit))
71              dc.DrawText("%s %s"%(interval, unit), 2*width+4 - l2width/2, 12)                  dc.DrawText("%s %s"%(interval, unit), 2*width+4 - l2width/2, 12)
72    

Legend:
Removed from v.869  
changed lines
  Added in v.871

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26