if (e->u.polyline.width > 1)
gc->meth.gc_set_linewidth(gc->priv, e->u.polyline.width);
if (e->u.polyline.width > 0 && e->u.polyline.dash_num > 0)
- graphics_gc_set_dashes(gc, e->u.polyline.width, 0,
+ graphics_gc_set_dashes(gc, e->u.polyline.width,
+ e->u.polyline.dash_offset,
e->u.polyline.dash_table,
e->u.polyline.dash_num);
gra->meth.draw_lines(gra->priv, gc->priv, di->pnt, di->count);
ITEM(piste_downhill_advanced)
ITEM(piste_downhill_expert)
ITEM(piste_downhill_freeride)
+ITEM(footway_and_piste_nordic)
/* Area */
ITEM2(0xc0000000,area)
ITEM2(0xc0000001,area_unspecified)
struct element *
polyline_new(struct color *color, int width, int directed,
- int *dash_table, int dash_num)
+ int dash_offset, int *dash_table, int dash_num)
{
struct element *e;
int i;
e->color=*color;
e->u.polyline.width=width;
e->u.polyline.directed=directed;
+ e->u.polyline.dash_offset = dash_offset;
e->u.polyline.dash_num=dash_num;
for (i=0; i<dash_num; i++)
e->u.polyline.dash_table[i] = dash_table[i];
int width;
int directed;
int dash_num;
+ int dash_offset;
unsigned char dash_table[4];
} polyline;
struct element_polygon {
void itemtype_add_element(struct itemtype *itemtype, struct element *element);
struct element *polygon_new(struct color *color);
struct element *polyline_new(struct color *color, int width, int directed,
- int *dash_table, int dash_num);
+ int dash_offset, int *dash_table, int dash_num);
struct element *circle_new(struct color *color, int radius, int width, int label_size);
struct element *label_new(int label_size);
struct element *icon_new(const char *src);
<polyline color="#696969" width="1" dash="5" />
</item>
<item type="piste_nordic" order="10-12">
- <polyline color="#0000ff" width="1" dash="3,6" />
+ <polyline color="#0000ff" width="1" dash="3,6" offset="4" />
</item>
<item type="piste_nordic" order="13-14">
- <polyline color="#0000ff" width="2" dash="4,8" />
+ <polyline color="#ffffff" width="4" dash="4,8" offset="6" />
+ <polyline color="#0000ff" width="2" dash="4,8" offset="6" />
</item>
<item type="piste_nordic" order="15-16">
- <polyline color="#0000ff" width="3" dash="5,10" />
+ <polyline color="#ffffff" width="5" dash="5,10" offset="7" />
+ <polyline color="#0000ff" width="3" dash="5,10" offset="7" />
</item>
<item type="piste_nordic" order="17-">
- <polyline color="#0000ff" width="5" dash="7,15" />
+ <polyline color="#ffffff" width="7" dash="7,15" offset="10" />
+ <polyline color="#0000ff" width="5" dash="7,15" offset="10" />
+ </item>
+ <item type="footway_and_piste_nordic" order="10-12">
+ <polyline color="#ff0000" width="1" dash="3,15" />
+ <polyline color="#0000ff" width="1" dash="3,15" offset="9" />
+ </item>
+ <item type="footway_and_piste_nordic" order="13-14">
+ <polyline color="#ffffff" width="4" dash="4,8" />
+ <polyline color="#ff0000" width="2" dash="4,20" />
+ <polyline color="#0000ff" width="2" dash="4,20" offset="12" />
+ </item>
+ <item type="footway_and_piste_nordic" order="15-16">
+ <polyline color="#ffffff" width="5" dash="5,10" />
+ <polyline color="#ff0000" width="3" dash="5,25" />
+ <polyline color="#0000ff" width="3" dash="5,25" offset="15" />
+ </item>
+ <item type="footway_and_piste_nordic" order="17-">
+ <polyline color="#ffffff" width="7" dash="7,15" />
+ <polyline color="#ff0000" width="5" dash="7,37" />
+ <polyline color="#0000ff" width="5" dash="7,37" offset="22" />
</item>
<item type="footway" order="10-12">
<polyline color="#ff0000" width="1" dash="3,6" />
"w highway=path,bicycle=designated cycleway\n"
"w highway=footway footway\n"
"w piste:type=nordic piste_nordic\n"
+ "w highway=footway,piste:type=nordic footway_and_piste_nordic\n"
"w route=ski piste_nordic\n"
"w piste:type=downhill,piste:difficulty=novice piste_downhill_novice\n"
"w piste:type=downhill,piste:difficulty=easy piste_downhill_easy\n"
xmlconfig_polyline(struct xmlstate *state)
{
struct color color;
- const char *width, *dash, *directed;
- int w=0, d=0, dt[4], ds=0;
+ const char *width, *dash, *directed, *dash_offset;
+ int w=0, d=0, doff=0, dt[4], ds=0;
if (! find_color(state, 1, &color))
return 0;
dash=find_attribute(state, "dash", 0);
if (dash)
ds=convert_number_list(dash, dt, sizeof(dt)/sizeof(*dt));
+ dash_offset=find_attribute(state, "offset", 0);
+ if (dash_offset)
+ doff=convert_number(dash_offset);
directed=find_attribute(state, "directed", 0);
if (directed)
d=convert_number(directed);
- state->element_attr.u.data=polyline_new(&color, w, d, dt, ds);
+ state->element_attr.u.data=polyline_new(&color, w, d, doff, dt, ds);
if (! state->element_attr.u.data)
return 0;
itemtype_add_element(state->parent->element_attr.u.data, state->element_attr.u.data);