dbg(1,"poly from map has only %d points\n", count);
continue;
}
- count=transform(t, pro, ca, pnt, count,
- item->type < type_line ? 1 : (item->type < type_area ? 5 : 7));
- if (!count) {
- dbg(1,"not visible\n");
- continue;
+ if (item->type < type_line) {
+ if (! map_selection_contains_point(sel, &ca[0])) {
+ dbg(1,"point not visible\n");
+ continue;
+ }
+ } else if (item->type < type_area) {
+ if (! map_selection_contains_polyline(sel, ca, count)) {
+ dbg(1,"polyline not visible\n");
+ continue;
+ }
+ } else {
+ if (! map_selection_contains_polygon(sel, ca, count)) {
+ dbg(1,"polygon not visible\n");
+ continue;
+ }
}
if (count == max)
dbg(0,"point count overflow\n", count);
+ count=transform(t, pro, ca, pnt, count, 1);
if (item->type >= type_line && count < 2) {
dbg(1,"poly from transform has only %d points\n", count);
continue;
while (curr) {
struct coord_rect *r=&curr->u.c_rect;
if (c->x >= r->lu.x && c->x <= r->rl.x &&
- c->y >= r->lu.y && c->y <= r->rl.y)
+ c->y <= r->lu.y && c->y >= r->rl.y)
return 1;
curr=curr->next;
}
enum projection pro;
int border=16;
+ if (! this_->ready)
+ return;
+
if (! vehicle_position_attr_get(nv->vehicle, attr_position_direction, &attr_dir) ||
! vehicle_position_attr_get(nv->vehicle, attr_position_speed, &attr_speed) ||
! vehicle_position_attr_get(nv->vehicle, attr_position_coord_geo, &attr_pos))
}
}
- if ((!transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 1) ||
- !transform_within_border(this_->trans, &cursor_pnt, border))) {
+ transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 0);
+ if (!transform_within_border(this_->trans, &cursor_pnt, border)) {
if (!this_->cursor_flag)
return;
if (nv->follow_curr != 1) {
}
int
-transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int flags)
+transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int unique)
{
struct coord c1;
int xcn, ycn;
double xc,yc;
#endif
int i,j = 0;
- if (flags & 1) {
- if (count == 1) {
- if (!map_selection_contains_point(t->map_sel, &c[0]))
- return 0;
- } else {
- if (flags & 2) {
- if (!map_selection_contains_polygon(t->map_sel, c, count))
- return 0;
- } else {
- if (!map_selection_contains_polyline(t->map_sel, c, count))
- return 0;
- }
- }
- }
for (i=0; i < count; i++) {
if (pro == t->pro) {
xc=c[i].x;
yc=-0x8000;
if (yc > 0x7fff)
yc=0x7fff;
- if (j == 0 || !(flags & 4) || p[j-1].x != xc || p[j-1].y != yc) {
+ if (j == 0 || !unique || p[j-1].x != xc || p[j-1].y != yc) {
p[j].x=xc;
p[j].y=yc;
j++;
void
transform_get_size(struct transformation *t, int *width, int *height)
{
- struct coord_rect *r=&t->screen_sel->u.p_rect;
- *width=r->rl.x-r->lu.y;
+ struct point_rect *r=&t->screen_sel->u.p_rect;
+ *width=r->rl.x-r->lu.x;
*height=r->rl.y-r->lu.y;
}