[Xastir-dev] Seeing weird fill patterns

Tom Russo russo at bogoflux.losalamos.nm.us
Sun May 30 23:50:34 EDT 2004


On Sun, May 30, 2004 at 03:41:54PM -0700, a Mr. Richard Feyler of Fort Lee, New Jersey <archer at eskimo.com> writes 'Dear Rosanne Rosannadanna':
> 
> I'm still seeing weird fill patterns, possibly due to the dbfawk
> stuff and weather alerts.
> 
> Are we assured that we're resetting the GC to non-stippled before we
> exit draw_shapefile_map() in all cases?  There are a lot of possible
> return areas from that routine, so perhaps things don't get reset in
> some cases?

Hmmmm.  Well, this used to happen *all* the time and I've not seen it in some
time.  It was once the case that once a WX alert came in that fill_style would
stay at FillStippled until another dbfawk explicitly reset it otherwise, but
some months ago I submitted a patch that resets fill_style to 0 each time
draw_shapefile_map is called, and I haven't seen that happen ever since.

dbfawkified draw_shapefile_map calls "XSetFillStyle" with the current value
of fill_style down around what is line 1648 of the version I have.  Prior to 
this fill_style has either gotten a value of fill_style from a dbfawk rule, 
used the default value currently defined in the current file's BEGIN_RECORD 
rule, or used the default value as set at the top of the routine, or if
it's a weather alert, it's been set right before that to FillStippled.

Since draw_shapefile_map resets fill_style to 0 each call, and 
XSetFillStyle is supposed to be called each time through draw_shapefile_map
that doesn't return prior to drawing, it shouldn't be the case that a weather 
alert can cause all subsequent fills to be stippled anymore.

It's true that there are many returns possible prior to this call of 
XSetFillStyle, but it seems that all of those would result in the current
shapefile not getting drawn.

On the other hand, the fill style is not reset to solid until the next
time a non-weather-alert draw_shapefile_map is called, which is wrong: perhaps 
the stipple pattern is still set for non-shapefile maps that get drawn
after your wx alert.  Perhaps another call to XSetFillStyle(XtDisplay(w), gc, 
FillSolid) needs to happen prior to all the returns subsequent to the one on 
line 1648 to be sure draw_shapefile_map cleans up its droppings when it's 
done instead of next time it gets called.

> Perhaps some of the dbfawk files don't handle this?

Question: are you seeing any instances of "No DBFAWK signature for (shapefile 
name)!  Using default." when you run the code?  It could be a problem related 
to the default rule, which contains no reset of the fill style variable (or 
much else, for that matter).

In map_shp.c the lines:

static awk_rule dbfawk_default_rules[] = {
    { 0, BEGIN, NULL, NULL, 0, 0, "dbfinfo=\"\"; key=\"\"; lanes=1; color=8; fill_color=13; name=\"\"; filled=0; pattern=0; display_level=8192; label_level=0",0 },
};

should be changed to

static awk_rule dbfawk_default_rules[] = {
    { 0, BEGIN, NULL, NULL, 0, 0, "dbfinfo=\"\"; key=\"\"; lanes=1; color=8; fill_color=13; name=\"\"; filled=0; fill_style=0; pattern=0; display_level=8192; label_level=0",0 },
};

(i.e. adding "fill_style=0" after "filled=0" at a minimum.  I don't see how
all the other default setting of fill_style could be allowing an old setting
of that variable to continue to stipple subsequent maps, but that's what's
going on there.

> What I appear to have now is the whole world stippled, and it
> doesn't reset by removing all maps or clearing all stations.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "If life gives you lemonade, kick it in the balls and say 'Hey, I wanted 
  a beer.'"  



More information about the Xastir-dev mailing list