Diff of /trunk/src/osm-gps-map-osd-classic.c

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

revision 114 by harbaum, Wed Sep 16 20:04:38 2009 UTC revision 120 by harbaum, Sat Sep 19 19:19:42 2009 UTC
# Line 285  osd_balloon_check(osm_gps_map_osd_t *osd Line 285  osd_balloon_check(osm_gps_map_osd_t *osd
285                                        priv->balloon.lat, priv->balloon.lon,                                        priv->balloon.lat, priv->balloon.lon,
286                                        &xs, &ys);                                        &xs, &ys);
287    
288        printf("click at %d/%d\n", x, y);
289    
290      xs += priv->balloon.rect.x + priv->balloon.offset_x;      xs += priv->balloon.rect.x + priv->balloon.offset_x;
291      ys += priv->balloon.rect.y + priv->balloon.offset_y;      ys += priv->balloon.rect.y + priv->balloon.offset_y;
292    
293      /* handle the fact that the balloon may have been created by the */      printf("balloon at %d/%d/%d/%d\n",
294      /* button down event */             xs, ys,
295               xs + priv->balloon.rect.w,
296               ys + priv->balloon.rect.h);
297    
298      gboolean is_in =      gboolean is_in =
299          (x > xs) && (x < xs + priv->balloon.rect.w) &&          (x > xs) && (x < xs + priv->balloon.rect.w) &&
300          (y > ys) && (y < ys + priv->balloon.rect.h);          (y > ys) && (y < ys + priv->balloon.rect.h);
301    
302        /* handle the fact that the balloon may have been created by the */
303        /* button down event */
304      if(!is_in && !down && !priv->balloon.just_created) {      if(!is_in && !down && !priv->balloon.just_created) {
305          /* the user actually clicked outside the balloon */          /* the user actually clicked outside the balloon */
306    
# Line 953  osd_check(osm_gps_map_osd_t *osd, gboole Line 959  osd_check(osm_gps_map_osd_t *osd, gboole
959  #endif  #endif
960    
961      if(but == OSD_NONE) {      if(but == OSD_NONE) {
962          x -= OSD_X;          gint mx = x - OSD_X;
963          y -= OSD_Y;          gint my = y - OSD_Y;
964    
965          if(OSD_X < 0)          if(OSD_X < 0)
966              x -= (osd->widget->allocation.width - OSD_W);              mx -= (osd->widget->allocation.width - OSD_W);
967    
968          if(OSD_Y < 0)          if(OSD_Y < 0)
969              y -= (osd->widget->allocation.height - OSD_H);              my -= (osd->widget->allocation.height - OSD_H);
970    
971          /* first do a rough test for the OSD area. */          /* first do a rough test for the OSD area. */
972          /* this is just to avoid an unnecessary detailed test */          /* this is just to avoid an unnecessary detailed test */
973          if(x > 0 && x < OSD_W && y > 0 && y < OSD_H) {          if(mx > 0 && mx < OSD_W && my > 0 && my < OSD_H) {
974  #ifndef OSD_NO_DPAD  #ifndef OSD_NO_DPAD
975              but = osd_check_dpad(x, y);              but = osd_check_dpad(mx, my);
976  #endif  #endif
977          }          }
978    
979          if(but == OSD_NONE)          if(but == OSD_NONE)
980              but = osd_check_zoom(x, y);              but = osd_check_zoom(mx, my);
981      }      }
982    
983  #ifdef OSD_BALLOON  #ifdef OSD_BALLOON

Legend:
Removed from v.114  
changed lines
  Added in v.120