Diff of /trunk/src/map.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by harbaum, Mon Dec 15 19:45:38 2008 UTC revision 15 by harbaum, Tue Dec 16 17:00:20 2008 UTC
# Line 209  void map_way_select(appdata_t *appdata, Line 209  void map_way_select(appdata_t *appdata,
209        diff.x = node_chain->node->lpos.x - last->lpos.x;        diff.x = node_chain->node->lpos.x - last->lpos.x;
210        diff.y = node_chain->node->lpos.y - last->lpos.y;        diff.y = node_chain->node->lpos.y - last->lpos.y;
211    
212          /* only draw arrow if there's sufficient space */
213          /* TODO: what if there's not enough space anywhere? */
214        float len = sqrt(pow(diff.x, 2)+pow(diff.y, 2));        float len = sqrt(pow(diff.x, 2)+pow(diff.y, 2));
215        if(len > map->style->highlight.arrow_limit*arrow_width) {        if(len > map->style->highlight.arrow_limit*arrow_width) {
216          len /= arrow_width;          len /= arrow_width;
# Line 771  map_item_t *map_item_at(map_t *map, gint Line 773  map_item_t *map_item_at(map_t *map, gint
773      return NULL;      return NULL;
774    }    }
775    
776    if(map_item->highlight)    if(map_item->highlight)
777      printf("  item is highlight\n");      printf("  item is highlight\n");
778    
779    switch(map_item->type) {    switch(map_item->type) {
# Line 790  map_item_t *map_item_at(map_t *map, gint Line 792  map_item_t *map_item_at(map_t *map, gint
792  }  }
793    
794  /* get the real item (no highlight) at x, y */  /* get the real item (no highlight) at x, y */
795  static map_item_t *map_real_item_at(map_t *map, gint x, gint y) {  map_item_t *map_real_item_at(map_t *map, gint x, gint y) {
796    map_item_t *map_item = map_item_at(map, x, y);    map_item_t *map_item = map_item_at(map, x, y);
797    
798    /* no item or already a real one */    /* no item or already a real one */
# Line 1626  static gboolean map_motion_notify_event( Line 1628  static gboolean map_motion_notify_event(
1628    case MAP_ACTION_NODE_ADD:    case MAP_ACTION_NODE_ADD:
1629      map_hl_cursor_draw(map, x, y, FALSE, map->style->node.radius);      map_hl_cursor_draw(map, x, y, FALSE, map->style->node.radius);
1630      break;      break;
1631    
1632    case MAP_ACTION_WAY_ADD:    case MAP_ACTION_WAY_ADD:
1633      map_hl_cursor_draw(map, x, y, FALSE, map->style->node.radius);      map_hl_cursor_draw(map, x, y, FALSE, map->style->node.radius);
1634      map_touchnode_update(appdata, x, y);      map_touchnode_update(appdata, x, y);
# Line 1634  static gboolean map_motion_notify_event( Line 1636  static gboolean map_motion_notify_event(
1636    
1637    case MAP_ACTION_WAY_NODE_ADD:    case MAP_ACTION_WAY_NODE_ADD:
1638      map_hl_cursor_clear(map);      map_hl_cursor_clear(map);
1639      map_item_t *item = map_item_at(map, x, y);      map_item_t *item = map_real_item_at(map, x, y);
1640      if(item) map_edit_way_node_add_highlight(map, item, x, y);      if(item) map_edit_way_node_add_highlight(map, item, x, y);
1641      break;      break;
1642    
1643    case MAP_ACTION_WAY_CUT:    case MAP_ACTION_WAY_CUT:
1644      map_hl_cursor_clear(map);      map_hl_cursor_clear(map);
1645      item = map_item_at(map, x, y);      item = map_real_item_at(map, x, y);
1646      if(item) map_edit_way_cut_highlight(map, item, x, y);      if(item) map_edit_way_cut_highlight(map, item, x, y);
1647      break;      break;
1648    

Legend:
Removed from v.14  
changed lines
  Added in v.15