}
void graphics_font_destroy(struct graphics_font *gra_font) {
+ if(!gra_font)
+ return;
gra_font->meth.font_destroy(gra_font->priv);
g_free(gra_font);
}
graphics_draw_polygon_clipped(gra, gc, pa, count);
break;
case element_polyline:
- {
+ {
gc->meth.gc_set_linewidth(gc->priv, 1);
if (e->u.polyline.width > 0 && e->u.polyline.dash_num > 0)
graphics_gc_set_dashes(gc, e->u.polyline.width,
if(displaylist->dc.trans!=trans)
displaylist->dc.trans=transform_dup(trans);
displaylist->dc.gra=gra;
- displaylist->dc.mindist=transform_get_scale(trans)/2;
+ displaylist->dc.mindist=flags&512?15:2;
// FIXME find a better place to set the background color
if (l) {
graphics_gc_set_background(gra->gc[0], &l->color);
struct point *pa=g_alloca(sizeof(struct point)*displaylist->dc.maxlen);
int count;
- count=transform(displaylist->dc.trans, displaylist->dc.pro, di->c, pa, di->count, 1, 0, NULL);
+ count=transform(displaylist->dc.trans, displaylist->dc.pro, di->c, pa, di->count, 0, 0, NULL);
if (di->item.type < type_line) {
return within_dist_point(p, &pa[0], dist);
graphics_displaylist_move(this_->displaylist, dx, dy);
#endif
graphics_draw_cancel(this_->gra, this_->displaylist);
- graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, this_->graphics_flags);
+ graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, this_->graphics_flags|512);
transform_destroy(tr);
this_->moved=1;
}
xc=c1.x;
yc=c1.y;
}
- if (i != 0 && i != count-1 && mindist) {
- if (xc > c[k].x-mindist && xc < c[k].x+mindist && yc > c[k].y-mindist && yc < c[k].y+mindist &&
- (c[i+1].x != c[0].x || c[i+1].y != c[0].y))
- continue;
- k=i;
- }
xm=xc;
ym=yc;
-// dbg(2,"0x%x, 0x%x - 0x%x,0x%x contains 0x%x,0x%x\n", t->r.lu.x, t->r.lu.y, t->r.rl.x, t->r.rl.y, c->x, c->y);
-// ret=coord_rect_contains(&t->r, c);
xc-=t->map_center.x;
yc-=t->map_center.y;
xc >>= t->scale_shift;
}
xc+=t->offx;
yc+=t->offy;
+
+ if (i != 0 && i != count-1 && mindist) {
+ /* We expect values of mindist to be within 0..5 pixels for nice looking screens.
+ That gives difference of about 1 pixel in worst case between abs(dx)+abs(dy) and sqrt(dx*dx+dy*dy).
+ We expect significantly bigger values when drawing map while scrolling it. But it anyway will be ugly.
+ Should anybody care about that inaccuracy? */
+ if ( (abs(xc - p[k].x) + abs(yc - p[k].y)) < mindist &&
+ (c[i+1].x != c[0].x || c[i+1].y != c[0].y))
+ continue;
+ k=j;
+ }
+
p[j].x=xc;
p[j].y=yc;
if (width_return) {