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

#683: Make d.scalebar look the same on different display sizes
-------------------------+--------------------------------------------------
Reporter: perk | Owner: grass-dev@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&gt;
GRASS GIS <http://grass.osgeo.org>

#683: Make d.scalebar look the same on different display sizes
--------------------------+-------------------------------------------------
  Reporter: perk | Owner: hamish
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: Display | Version: svn-develbranch6
Resolution: | Keywords: scalebar
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by hamish):

* cc: grass-dev@lists.osgeo.org (added)
  * owner: grass-dev@lists.osgeo.org => hamish
  * status: new => assigned

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/683#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#683: Make d.barscale look the same on different display sizes
--------------------------------------------------+-------------------------
Reporter: perk | Owner: hamish
     Type: enhancement | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: d.barscale, proportional decorations | Platform: All
      Cpu: All |
--------------------------------------------------+-------------------------
Changes (by hamish):

  * keywords: scalebar => d.barscale, proportional decorations
  * version: svn-develbranch6 => svn-trunk
  * milestone: 6.5.0 => 7.0.0

Comment:

I see your point, but this goes much deeper than just the d.barscale
module, e.g. line width from d.vect exported with d.out.file and a large
size= or resolution=4.

GRASS 6's display architecture is inherently pixel based, and for visual-
backwards compatibility reasons I would not like to change the default
behaviour there. Perhaps as a new optional flag in 6.5svn, but really I
think this is much better handled first in trunk, and with the additional
capability of allowing SVG/EPS symbols with with d.mark addon module (see
TODO on d.graph help page) + a new d.mark flag to indicate size= is
percentage of frame sqrt(height^2+width+2), as is done with d.text font
size.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/683#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>