--- trunk/src/osm-gps-map-osd-classic.c 2009/09/19 11:46:20 119 +++ trunk/src/osm-gps-map-osd-classic.c 2009/09/19 19:19:42 120 @@ -285,16 +285,22 @@ priv->balloon.lat, priv->balloon.lon, &xs, &ys); + printf("click at %d/%d\n", x, y); + xs += priv->balloon.rect.x + priv->balloon.offset_x; ys += priv->balloon.rect.y + priv->balloon.offset_y; - /* handle the fact that the balloon may have been created by the */ - /* button down event */ + printf("balloon at %d/%d/%d/%d\n", + xs, ys, + xs + priv->balloon.rect.w, + ys + priv->balloon.rect.h); gboolean is_in = (x > xs) && (x < xs + priv->balloon.rect.w) && (y > ys) && (y < ys + priv->balloon.rect.h); + /* handle the fact that the balloon may have been created by the */ + /* button down event */ if(!is_in && !down && !priv->balloon.just_created) { /* the user actually clicked outside the balloon */ @@ -953,25 +959,25 @@ #endif if(but == OSD_NONE) { - x -= OSD_X; - y -= OSD_Y; + gint mx = x - OSD_X; + gint my = y - OSD_Y; if(OSD_X < 0) - x -= (osd->widget->allocation.width - OSD_W); + mx -= (osd->widget->allocation.width - OSD_W); if(OSD_Y < 0) - y -= (osd->widget->allocation.height - OSD_H); + my -= (osd->widget->allocation.height - OSD_H); /* first do a rough test for the OSD area. */ /* this is just to avoid an unnecessary detailed test */ - if(x > 0 && x < OSD_W && y > 0 && y < OSD_H) { + if(mx > 0 && mx < OSD_W && my > 0 && my < OSD_H) { #ifndef OSD_NO_DPAD - but = osd_check_dpad(x, y); + but = osd_check_dpad(mx, my); #endif } if(but == OSD_NONE) - but = osd_check_zoom(x, y); + but = osd_check_zoom(mx, my); } #ifdef OSD_BALLOON