[GRASS-dev] [GRASS GIS] #3013: support background and border for d.legend

GRASS GIS trac at osgeo.org
Thu Jun 16 05:17:55 PDT 2016


#3013: support background and border for d.legend
-------------------------+-------------------------------------------------
  Reporter:  annakrat    |      Owner:  grass-dev@…
      Type:              |     Status:  new
  enhancement            |
  Priority:  normal      |  Milestone:  7.3.0
 Component:  Display     |    Version:  svn-trunk
Resolution:              |   Keywords:  d.legend, background, gsoc2016,
       CPU:              |  cartography
  Unspecified            |   Platform:  All
-------------------------+-------------------------------------------------

Comment (by lazaa):

 Replying to [comment:10 annakrat]:
 > > > Replying to [comment:7 lazaa]:
 > > > > Added flag {{{-b}}} and option {{{brdcolor}}} and {{{bgcolor}}} to
 draw background. Also added option{{{font_size}}} as requested. Code was
 separeted from main.c to background.c and draw.c. For background purpose
 in case of {{{-d}}} flag (histogram) added function calc_histogram in
 histrogram2.c
 >
 > Tested, it works. However, the code is not maintainable like this, you
 have too large overlap between `draw` and `background` functions. I
 suggest to merge those functions and use ifs and put some parts into
 separate functions. Also check during compilation for warnings, there were
 a couple of them, probably not serious, but better to fix them.

 That's right, I didn't realize possible problems with maintaining code. So
 I moved it to one function and used parameter {{{draw}}} and if
 conditions. Draw=0 is for calculation and draw=1 for calculation and
 drawing. I don't get any warnings now, so I hope it's OK.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3013#comment:11>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list