From: sfeam <sf...@us...> - 2014-09-16 04:48:12
|
On Monday, 15 September 2014 09:27:24 PM Christoph Bersch wrote: > Hi, > > Am 02.09.2014 22:18, schrieb Ethan A Merritt: > > > > (2) > > The linetype LT_NODRAW (defined as -3 in term_api.h) is supposed > > to indicate that this line is not drawn at all. When applied to a fill area > > it is supposed to indicate that no fill is present (i.e. 100% transparent). > > The lua code is treating this the same as LT_BACKGROUND, which is > > suppoed to mean "draw this line in the background color". > > It is true that if you are drawing directly onto the background these both > > come out the same. But if you draw a new line on top of a dark area, > > say a previous filled area, then they most certainly are not the same. > > the more I look through the code, the more confused I get concerning the > handling of LT_BACKGROUND, LT_NODRAW and FS_EMPTY: > > * According to comments in many terminal drivers, FS_EMPTY is handled as > if it should be filled with background color. However, I didn't manage > to get any plot command which actually delivers the FS_EMPTY style to > the terminal driver. Do you have an example? I wish I could say that all the intersecting features, code, and terminal support followed some grand plan that had been well designed and laid out in advance. The addition of fill styles, including FS_EMPTY, came before any of the rest. It was a top-down design: the top level data structures and syntax came first, terminal support got added later one at a time. So yeah, it could be that FS_EMPTY is implemented entirely in the core code and none of the terminals ever sees that flag. > I would expect the FS_EMPTY call to be handled like LT_NODRAW, i.e. no > fillarea should be drawn at all. Yes. > * Based on your description above (LT_NODRAW applied to a fill area), I > constructed the following script: > > set object rectangle from graph 0,0 to graph 1,1 fc rgb 'red' fs solid > set object polygon from graph 0.2,0.2 to graph 0.5,0.2 to graph 0.6, 0.7 > fs solid fc lt -3 > > plot x > > That however fails on all terminals I tested and always draws a white > polygon (tested cairo terminals, qt, svg, lua). Remember that until relatively recently there was no clear distinction between "linetype" and "line color". The idea that "background" can be a color rather than a terminal property was introduced, I think, in version 4.2. In version 5 I hope we have managed to disentangle linetype from color. So "fillcolor bgnd" makes sense because "background" is a color. But "fillcolor LT_NODRAW" does not, although I suppose if is accepted at all then background color is the most logical thing to get. Getting back to the lua terminal, my concern was specifically with term->linetype(LT_NODRAW) followed by a series of term->vector() commands. Several places in the core code now emit this sequence in order to "not draw" pieces of a surface or grid. Arguably this should be changed in the core code rather than individual terminals, but at the moment it depends on the terminal itself knowing to turn the vector commands into move commands when the current linetype is LT_NODRAW. Ethan |