Logo Search packages:      
Sourcecode: navit version File versions

static int map_selection_contains_rect ( struct map_selection sel,
struct coord_rect *  r 
) [inline, static]

Checks if a rectangle is within a map selection.

See also:
Please refer to map_selection_contains_point()
sel The selection to check if the rectangle is within
r Rectangle to be checked for
True if the rectangle is within one of the selections, False otherwise

Definition at line 159 of file map.h.

References map_selection::c_rect, map_selection::next, and map_selection::u.

Referenced by map_selection_contains_item_rect(), and map_selection_contains_polygon().

      struct map_selection *curr;

      dbg_assert(r->lu.x <= r->rl.x);
      dbg_assert(r->lu.y >= r->rl.y);

      if (! sel)
            return 1;
      while (curr) {
            struct coord_rect *sr=&curr->u.c_rect;
            dbg_assert(sr->lu.x <= sr->rl.x);
            dbg_assert(sr->lu.y >= sr->rl.y);
            if (r->lu.x <= sr->rl.x && r->rl.x >= sr->lu.x &&
                r->lu.y >= sr->rl.y && r->rl.y <= sr->lu.y)
                  return 1;
      return 0;

Generated by  Doxygen 1.6.0   Back to index