[GRASS-dev] [GRASS GIS] #683: Make d.scalebar look the same on different display sizes

GRASS GIS trac at osgeo.org
Mon Jul 13 11:37:46 EDT 2009


#683: Make d.scalebar look the same on different display sizes
-------------------------+--------------------------------------------------
 Reporter:  perk         |       Owner:  grass-dev at lists.osgeo.org
     Type:  enhancement  |      Status:  new                      
 Priority:  normal       |   Milestone:  6.5.0                    
Component:  Display      |     Version:  svn-develbranch6         
 Keywords:  scalebar     |    Platform:  All                      
      Cpu:  All          |  
-------------------------+--------------------------------------------------
 The current d.barscale is display dependent.  The scale produced looks
 great on a display that's 640x480 pixels, but is unreadable on a
 2400x1800 PNG display. Compare attached scalebar-default-before.png
 with barscale-big-after.png. This is also pretty easy to see by
 drawing a scalebar on an X11 display then making it full screen.

 I think that the scale bar size should relative to the display size,
 not pixel size.  I started out to fix this problem and thought it
 would be a relatively minor change.  However, I ended up recoded a
 good deal of it because all of the relative sizes were hard coded and
 duplicated in several places.

 I think I've succeeded in my main goal: the proportions of the
 scalebar remain the same regardless of display size.  The default
 behavior is very much the same as before, but a little cleaner (IMO).
 The layout is changed slightly but is very similar to the original.
 The only significant layout change was the positioning of the north
 arrow when text is above the scale bar.  It is now larger and
 vertically centered in the surrounding box.

 I went on to add an "enlarge" option to shrink or enlarge the scalebar
 to get the text and north arrow just the right size by specifying an
 size percentage (100% = default).

 Hopefully, the code is a little cleaner now, but it's still not as
 clean as I would like.  It at least has fulfilled my immediate need.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/683>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list