[GRASS-dev] Re: not quite there on fonts

Glynn Clements glynn at gclements.plus.com
Sun May 13 12:53:54 EDT 2007


Michael Barton wrote:

> I'll play around with these. But maybe one of you can check to see if
> d.histogram will actually accept some kind of background color change or if
> it is hardcoded to white--so I don't waste a lot of time messing with this
> in situation where it won't work.

d.histogram calls:

	D_setup(1); /* 1 = clear frame */

This clears the frame by filling a rectangle thus:

	R_standard_color(D_translate_color(DEFAULT_BG_COLOR));
	R_box_abs (l, t, r, b);

There isn't any way to erase a portion of the screen to transparent. 
You can erase the entire screen with R_erase(); for the PNG driver,
this will erase to transparent if GRASS_TRANSPARENT is TRUE.

Even if R_erase() was changed to erase the clip rectangle (i.e. the
current frame), another problem is that the display library erases
using the current erase colour (which is set by d.erase), and there is
no way to refer to "transparent" as a colour.

Using R_erase() will ignore the erase colour, which will do the wrong
thing if you have erased the screen to a non-default colour using
d.erase.

Regarding d.histogram, it could just use D_setup(0) to avoid erasing
the frame. I'm guessing that (unlike most modules) it automatically
erases because the output isn't georeferenced, so there would be no
reason to overlay it on top of what is already displayed.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list