Diff of /trunk/src/map_edit.c

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

revision 15 by harbaum, Tue Dec 16 17:00:20 2008 UTC revision 54 by harbaum, Fri Feb 6 12:06:30 2009 UTC
# Line 645  void map_edit_node_move(appdata_t *appda Line 645  void map_edit_node_move(appdata_t *appda
645    
646    /* check if it was dropped onto another node */    /* check if it was dropped onto another node */
647    node_t *touchnode = map_hl_touchnode_get_node(map);    node_t *touchnode = map_hl_touchnode_get_node(map);
648      gboolean joined_with_touchnode = FALSE;
649    
650    if(touchnode) {    if(touchnode) {
651      map_hl_touchnode_clear(map);      map_hl_touchnode_clear(map);
652    
# Line 658  void map_edit_node_move(appdata_t *appda Line 660  void map_edit_node_move(appdata_t *appda
660    
661        /* the touchnode vanishes and is replaced by the node the */        /* the touchnode vanishes and is replaced by the node the */
662        /* user dropped onto it */        /* user dropped onto it */
663          joined_with_touchnode = TRUE;
664    
665        /* use touchnodes position */        /* use touchnodes position */
666        node->lpos = touchnode->lpos;        node->lpos = touchnode->lpos;
# Line 857  void map_edit_node_move(appdata_t *appda Line 860  void map_edit_node_move(appdata_t *appda
860          }          }
861        }        }
862      }      }
863    } else {    }
864    
865      /* the node either wasn't dropped into another one (touchnode) or */
866      /* the user didn't want to join the nodes */
867      if(!joined_with_touchnode) {
868    
869      /* finally update dragged nodes position */      /* finally update dragged nodes position */
870    
# Line 872  void map_edit_node_move(appdata_t *appda Line 879  void map_edit_node_move(appdata_t *appda
879      node->lpos.x = x;      node->lpos.x = x;
880      node->lpos.y = y;      node->lpos.y = y;
881    
882      /* convert screen position back to ll */      /* convert screen position to lat/lon */
883      lpos2pos(osm->bounds, &node->lpos, &node->pos);      lpos2pos(osm->bounds, &node->lpos, &node->pos);
884    
885        /* convert pos back to lpos to see rounding errors */
886        pos2lpos(osm->bounds, &node->pos, &node->lpos);
887    
888      printf("  now at %d %d (%f %f)\n",      printf("  now at %d %d (%f %f)\n",
889             node->lpos.x, node->lpos.y, node->pos.lat, node->pos.lon);             node->lpos.x, node->lpos.y, node->pos.lat, node->pos.lon);
890    }    }

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